- Home /
Animation keeps playing
Hello! Pretty much I have an animation to where when you press Space, a panel comes down, and when you press Space again, it goes up. I have both the animations working, but when the second animation ends (when the panel goes back up), then the panel comes back down, which is the first animation. Can anyone help? Thanks.
Can you show us the code you are using to start these animations?
With just the information you have provided, it is unlikely anyone would be able to come up with a solution for you.
-Larry
Answer by zero_null · Dec 28, 2017 at 07:42 AM
Hello Did you have the loop enabled on your Animations ???
Are you using transitions ? Make sure your parameters values are not set in a manner that these are triggering the first animation again!
or if you are using the Animation.Play Function then you must be triggering it from the Script again.
Answer by theANMATOR2b · Dec 28, 2017 at 06:51 PM
You need 4 animation states in your motion flow, or need to stop the animations at the last frame via code. The 4 states you would need if not using code is motionless up, moving down, motionless down, and moving up. Transition from the moving state into the motionless states. Only transition out of the motionless state IF space bar is pushed. If down - transition into moving up, if up transition into moving down. Once the moving animations complete it auto transitions into motionless animation.
(I'm not a coder - this is only simple logic)
Your answer
Follow this Question
Related Questions
Model has Animator, how do I force start an animation, and tell where it is? (C#) 1 Answer
Play animation OnTriggerEnter (C#) 1 Answer
Transition Animations at end of current loop 0 Answers
Animation method/coroutine playable once or loop 0 Answers
Play animation if Player is close within certain distance. 1 Answer