Problem Animation Blend

Hi i have problem blend, I add animation.Blend but doesn’t work… Can you check my code and answers?

My code’s:

function OnGUI () {
    if(GUI.Button (Rect (215,Screen.height - 30,60,20), "Enter")){
			animation["Red"].wrapMode = WrapMode.Once;
			animation.Blend("Red");
			}
			else
			{
	if(GUI.Button (Rect (290,Screen.height - 30,60,20), "Enter")){
			animation["Green"].wrapMode = WrapMode.Once;
			animation.Blend("Green");
			}
    }
}

Sorry my bad speak english.

1 Answer

1

If your animation is on the same layer or higher than any other animations then that code will work presuming the animation is actually enabled and playing.

perhaps

   var red = animation["Red"];
   red.wrapMode=WrapMode.Once;
   red.speed = 1;
   red.enabled = true;
   animation.Blend("Red");

Thanks for speed reply. But doesn't work your code with animation blend.

–

Try adding red.layer = 3000; and see if it does then.

–

Again doesn't work :( Please again help me!

–

Ah ok, maybe red.time = 0; as well (put it back to the beginning)

–

Again... I try time to 3000 and -1 but doesn't work :(

–