I have a sliding door, i already made the 2 animations for each door.
Open and Close, i have the collider set as a trigger, and a sound on the trigger object.
When i walk into the collider i hear the sound but only the right door slides open?
And if i exit the collider i only the right door slides closed.
SO why is the left door not opening? it is animated properly i tested it.
I added them in order under Animation:
1,2,3,4
private var enter : boolean;
function OnTriggerEnter (other : Collider){
if (other.gameObject.tag == "Player") {
enter = true;
animation.Play("SlidingDoors");
animation.Play("SlidingDoors3");
audio.Play();
}
}
function OnTriggerExit (other : Collider){
if (other.gameObject.tag == "Player") {
enter = false;
audio.Play();
animation.Play("SlidingDoors2");
animation.Play("SlidingDoors4");
}
}
Any help would be nice, it's driving me crazy i must have missed something.
Update: SlidingDoors = Left Door/Open, SlidingDoors3 = Right Door/Open.
SlidingDoors2 = Left Door/Close, SlidingDoors4 = Right Door/Close.
↧