I can’t the script below to work. It is attached to a game object which also has the “inciseS” script attached to it.
animation["inciseS"].speed = 1.75;
var itoggle : boolean = false;
function Update (){
if (Input.GetKeyDown(KeyCode.I))
itoggle = !itoggle;
if(itoggle)
animation.Play("inciseS");
else if(!itoggle || Input.GetKeyDown(KeyCode.R))
animation.Stop("inciseS");
}
The “R” key doesn’t work to stop the animation; only the toggle button “I” is working to stop the clip. I have the “R” key assigned to toggle a clip on a different game object - could this be why?