playMaker

Author Topic: Newb: How do I stop an animation?  (Read 2313 times)

nluckett

  • Playmaker Newbie
  • *
  • Posts: 5
    • View Profile
Newb: How do I stop an animation?
« on: October 13, 2014, 05:14:56 PM »
I have a character with an animation controller on him (an asset from the asset store) and it works well. I want to add a throw action to him.

I got the ball and spawner and all that figured out, but I can't figure out how to animate the guy doing the throwing motion.

I got it to play finally by creating a sprite based animation called p1_throw and hooked it up to a new state in the Unity Animator called Throw. Then calling that from a Animator Play command on the FSM.

It finally plays... but it loops forever. I tried putting a FINISHED on it and it doesn't do the trick. I tried putting an Animator Stop Playback and that doesnt work either.

Any suggestions?

beaumint

  • Playmaker Newbie
  • *
  • Posts: 15
    • View Profile
Re: Newb: How do I stop an animation?
« Reply #1 on: October 13, 2014, 05:56:45 PM »
I'm a bit new too, but I know that if you find the animation that you use from the model you imported it off of... you can uncheck 'looping' there and it shouldn't loop...


nluckett

  • Playmaker Newbie
  • *
  • Posts: 5
    • View Profile
Re: Newb: How do I stop an animation?
« Reply #2 on: October 13, 2014, 06:57:01 PM »
Ok, that is a step in the right direction, thanks!

Now it plays once through without looping anymore. Now I need to get it to play each time I do a button press. It seems like it should cuz the firing of bullets works with each click...

And then I need it to kick me back to my base idle animation state, but it's just staying on the Throw Animator state.

nluckett

  • Playmaker Newbie
  • *
  • Posts: 5
    • View Profile
Re: Newb: How do I stop an animation?
« Reply #3 on: October 14, 2014, 11:04:32 AM »
Just to bump this, still looking for help.

One thought I had to get it out of the Throw Animator state and back to idle is to maybe just call the idle state at the end of the loop. But Im not sure if that is the right way to do it. Any ideas?

beaumint

  • Playmaker Newbie
  • *
  • Posts: 15
    • View Profile
Re: Newb: How do I stop an animation?
« Reply #4 on: October 16, 2014, 03:30:20 PM »
Did you figure it out?

You should try playing in the 'animator' section.

That way you can have it play your 'throw animation' and then after it's over it will automatically go back to the idle state.

Then in your playmaker setup you can force it to go back into the 'throw animation' part when you shoot again.

Let me know if you need a little bit more info!
Cheers!
-Beaumint

nluckett

  • Playmaker Newbie
  • *
  • Posts: 5
    • View Profile
Re: Newb: How do I stop an animation?
« Reply #5 on: October 16, 2014, 05:21:03 PM »
I think I figured it out using the Animator Play action. It then calls a State in a new Layer of the Animator/Mechanic thing. That layer has a default state, and then it has a THROW state that gets called from the FSM. When not called that layer just sits in the default (essentially inactive) state.

See any problems with that? Seems to be working. Fingers crossed.

beaumint

  • Playmaker Newbie
  • *
  • Posts: 15
    • View Profile
Re: Newb: How do I stop an animation?
« Reply #6 on: October 16, 2014, 06:01:12 PM »
I mean as long as it's getting the job done of what you want/expect then by all means go with it.

If for some reason down the line you don't think it's working let me know, I'll try and see if I can help ^^

nluckett

  • Playmaker Newbie
  • *
  • Posts: 5
    • View Profile
Re: Newb: How do I stop an animation?
« Reply #7 on: October 17, 2014, 06:43:05 AM »
Thanks man, really appreciate it! Good luck on your projects as well.