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.
where u added this script,
– Moorare the animations stored on the doors themselves or the parent of them? if the animations are stored on the separate doors you need to add the script to the left door as well.
– Fornoreason1000@ Moor, (where u added this script,). Umm as i said above i have it on my Trigger Object. @ Fornoreason1000, i tried several variations of that. 2 triggers/1 trigger both doors as children it just would not work. But i got it solved now thanks to ( GameVortex ) below!
– TheGeekyDead@TheGeekyDead: I removed the "solved" in the title since that's not part of the question. A question should not include an answer or anything related to an answer. A question is marked as solved by picking an answer (which you already did). I also removed all of your tags. Tags should represent your actual problem with short keywords. Things like "help", "code", "error" or "script" are useless. I've replaced them with more appropriate ones.
– Bunny83Ok bunny, i wont add solved to the topic title anymore, but whats with the second post? (i don't talk to TheGeekyDead since he can't vote yet). If no one votes questions up all those who just ask questions but don't post answers never get any karma)? I clicked the Check Mark, i believe that means "Correct Answer", but i always forget to click the thumbs up, so i just did for him. As for tags i have always hated them... I try to make it biased on my issue i am having, but i guess that was wrong sorry.
– TheGeekyDead