I have animated a needle to go one way and stop when entering a collision box, now i would like it to reverse back to its normal state and stop again
when the player exits the collision box is there anyway of doing this?#pragma strict
var AnimateNeedle : AnimationClip;
function Start ()
{
GameObject.Find("needle").GetComponent.<Animation>().Stop("needleanimated");
}
function OnTriggerEnter ()
{
GameObject.Find("needle").GetComponent.<Animation>().Play("needleanimated");
}
function OnTriggerExit()
{
}