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?

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.
60799-untitled1.png

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: