Animator, how to stop loop of clip

Hello everyone,
I have started to figure out Animator feature, but it is still very confusing. The biggest problem is that I have a clip and it is not looped. I set a trigger to make it play when press fire button. And when I press it once clip is keep running in Animator, and animator.GetCurrentAnimationClipState(0).Length is 1 all the time. What I am doing wrong?

Code sample:
void Update () {

        if (animator.GetCurrentAnimationClipState(0).Length == 0f)
            currentState = hidden;
        if (control.FirstShoot & currentState)
            hidden = false;
        else if (control.FirstShoot & !currentState)
            hidden = true;



Have you set the base humanoid animation to loop. If not it will just play once.



Sorry I may have misread that. Do you just want it to do one animation and then go back to what it was doing? If so then set a transition for exit time, in your example 1 second but in my screen shot I use .81 exit time.


You’ve also got your transitions going from idle to hide then hide to unhide but no way of going from unhide to normal.

Damn I hope some of this helps, pretty late where I am (apologies if posting rubbish) so may have to drop this for others to help!

Or just set up speed = 0f;, but tjis is something like “pause”, or play any empty state like
animator.Play(“emptyState”), when this state has 0 speed