Loop Animation In Script?

Is there anyway to make only 1 of my animations on my character loop? I thought about this as a script and looked it up on Google but I couldn’t find anything, is it possible or is there some other way?

Try adding this to OnStart:

 animation["Animation Name"].wrapMode = WrapMode.Loop;

to make it easier, Why don’t you just set the animation to a loop When you put the KeyFrames in, Then use a simple activate animation script something like,

function Update ()

// if you want to add more animations then put 

else if(Input.GetKey("What Key You Need"))

  animation.Play("What Animation You Need");

// Then if you wanted a idle to play it would be


Hope This helped :slight_smile: