My Animation Loops 3/4 of the way through

Im trying to make my Walk animation Loop correctly.

My animation correctly works in preview but when I do it in the game tab, it goes 3/4 of the way through the cycle then loops instead of waiting for the animation to completely finish then loop.
Here’s my script

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class player : MonoBehaviour {
	public Animator anim;
	// Use this for initialization
	void Start () {
		anim = GetComponent<Animator> ();
	}
	
	// Update is called once per frame
	void Update () {
		if (Input.GetKey ("w")) {
			anim.Play("walk01");
		}
		if(Input.GetKeyDown ("space")){
			anim.Play("jump01");
		}
	}
}

Here’s where my animation loops

As you can see it doesn’t reach the end of the animation clip but loops at the 3/4 mark.

How do I fix it? thx for any help

I tried you first two suggestions, I haven’t made a transition from idle01 to jump01 because then the idle animation automatically goes to jump randomly when I don’t want it to, I realize that maybe I didnt explain the problem well enough, heres a 10 second video 3:4walkglitch.mov - Google Drive
In the video it correctly plays the animation, but halfway through it loops instead of waiting till the animation finishes then looping, thanks for any help, thanks for the suggestions @paincide

There are some ways to try

  • Check if you haven’t checked has exit time
  • Try using bool from Parameters.
  • Why is there only ‘walk01-> killer01’ and ‘jump01->killer01’? Maybe that can cause a problem.
  • You can use animations and use animation.playqueued.

Is the transition from the animator state “walk01” to “idle01” set to automatically trigger after some given time? Because in this case the line “anim.Play(“walk01”);” would reset the animation to the start afterwards. It looks like that because in your movie the idle animation seems to be playing for a frame.