]using UnityEngine;
using System.Collections;
public class anienable : MonoBehaviour {
void Update() {
//animation["Catch"].enabled = true;
//animation["Catch"].weight = 1.0F;
}
void OnCollisionEnter(Collision other)
{
animation.Play("Catch");
}
}
i want to play this animatio for 20 seconds how to do that .please help me .but my anmation playing for juist 2seconds .how to expand this timings
thanks in advance
Asii
November 1, 2012, 1:18pm
2
make a loop use the animation.wrapMode = WrapMode.Loop; to make it loop then use waitforsec then use the animation.Stop(); and animation.wrapMode = WrapMode.Once; hope this helps. 1 thing this cant be used in update function
After you set the animations to loop, use the OnCollisionStay() { } to keep playing animations if the purpose is to play while in collision.
Also get this tool to help you debug the animations you have, and see what is working or not.
http://forum.unity3d.com/threads/155527-RELEASED-Animation-Inspector-only-U-5.00-don-t-miss-it
Best of luck