I have three doors that need to open simultaneously when the player steps on trigger plate on the floor. The Animations for each door play fine in the inspector, and will play automatically if set to do so. I just can’t seem to get them to play from script. The triggers for the door are functioning properly as I can get each to play an audio file when triggered, but not the animation.
Animation rigs are set to legacy with generation set to store in root(new).
Each door has the following script attached to it:
#pragma strict
private var enter : boolean;
public var GATElockAnim : GameObject;
function OnTriggerEnter (other : Collider){
if (other.gameObject.tag == "Player") {
enter = true;
GATElockAnim.animation.Play("DoorOpen1");
audio.Play();
}
}
The console shows NO errors when playing the level.
If there is a better way to do this than how I am doing it feel free to let me know. This is probably a simple fix that I just don’t get (being a noob).
Thanks in advance.