I’m able to do it with legacy animations using this code -
private var hasPlayed = false;
var other : GameObject;
function OnTriggerEnter(){
if(!hasPlayed){
other.GetComponent.<Animation>().Play();;
hasPlayed = true;
}
}
How would I edit this to use the animator instead of legacy.
I’ve looked around and can’t seem to find an answer. Any help would be appreciated.