How do i extend a animation ?
hi guys,
I'm making a game similiar to flappybird for a school project. So i followed tutorials on youtube etc. And the problem I have is when my bird doesn't flap but just float ,it shows the floating animation and then the dead animation right after. This should occur when the bird hits the pipes. the code i used for the dead aimation to occur.
void OnCollisionEnter2D(Collision2D collision) {
animator.SetTrigger("dead");
} How can i fix this? And how can i extend the float animation?
Answer by p1g30n · Dec 28, 2015 at 09:35 PM
Too extend animation, you can easily loop it in animation settings. Also you need to configure your transitions in animator. There is a great video about it: https://unity3d.com/learn/tutorials/modules/beginner/2d/2d-controllers?playlist=17093 Animations starts on ~30 min. I don't reallu know what you have, but it's example of my animator. You need to make transtions like Entry -> Float -> Dead.
I have same situation so I use in script: anim.SetTrigger("dead");
P.S. I'm green in programming, so my answer may be not helpful D:
Your answer
Follow this Question
Related Questions
Trigger the Animation #2 after Animation #1 was triggered 0 Answers
How do I stop an animation from looping? 1 Answer
Depending on the mouse movement (or position), the player sprite 0 Answers
Player doesn't face in direction of its last movement direction 0 Answers
Starting animations at the same time but still getting desynced 0 Answers