Animation doesn't play D:

Why those animation doesn’t play?

var playerWeapons : GameObject;
private var moveDirection = Vector3.zero;

function Start()
{
     playerWeapons.animation.wrapMode = WrapMode.Loop;
}

function Update()
{
     ......

    if (grounded  moveDirection.magnitude < 7  moveDirection.magnitude > 4  !Input.GetButton("Fire2"))
{
		playerWeapons.animation.CrossFade("Walk");
}
else if (grounded  moveDirection.magnitude < 14  moveDirection.magnitude > 8)
{
		playerWeapons.animation.CrossFade("Run");
}
else if (grounded  moveDirection.magnitude < 3  moveDirection.magnitude > 1  Input.GetButton("Fire2"))

	    playerWeapons.animation.CrossFade("CrouchAim");

else

	    playerWeapons.animation.CrossFade("IdleAnim");

}

Thanks in Advance

Use a Debug to see if your if else statements are working. Also you can see in the inspector if the clip is being loaded as the current clip playing. I think that you can also find out if the clip is Playing through code too.

Solved thanks. The problem was the block of code isn’t in function Update() :slight_smile: