The following is my code that sets up the animations that are played when certain events occur. For some reason however I can only get the WrapMode.Once to work on the jump animation, the attack one just loops. Someone please help?
Code:
private void Setup()
{
_moveDirection = Vector3.zero;
animation.Stop();
animation.wrapMode = WrapMode.Loop;
animation["jump"].layer = 1;
animation["jump"].wrapMode = WrapMode.Once;
animation["attack"].wrapMode = WrapMode.Once;
animation.Play("idle");
_run = true;
_jump = false;
_attackButton = false;
}