Question by
StanTheGuy · Feb 26, 2016 at 09:00 AM ·
animationtriggercolliderscutscene
Play other object's animation on camera trigger
I have looked at http://answers.unity3d.com/questions/563518/play-animation-when-colliding-with-trigger.html
I am trying to get some elevator doors to open in a cutscene, when the camera enters a trigger box collider. (entering the elevator and the doors close)
My Code (Javascript):
#pragma strict
var door1 : GameObject;
var door2 : GameObject;
function OnTriggerEnter (Other : Collider){
if(Other.gameObject.tag == "Main Camera"){
door1.GetComponent.<Animation>().Play("Elevatordoor1_2");
}
}
However it still doesn't do anything, I am really getting overly confused.
Comment