I want these animations to loop on button press. They are set to loop on the model, and even in the Animation component every animation wrap mode is set to loop. But these will only make them play the first frame and then return to idle. Here’s my code:
function Update (){
if(Input.GetKeyUp("n")){
animation.Play("sit");
//sit using N
}
if(Input.GetKeyDown("m")){
animation.Play("stand_001");
//stand using M
}
if(Input.GetKeyDown("v")){
animation.Play("sleeps");
// sleep on V
}
}
If I try
if(Input.GetKeyDown("b")){
animation("sit").wrapMode = WrapMode.Loop
animation.Play("sit")
it brings up and error saying
Assets/AnimalIdles.js(6,3): BCE0077: It is not possible to invoke an expression of type ‘UnityEngine.Animation’.
I’m at a loss