Quantcast
Channel: Latest Questions by TheGeekyDead
Viewing all articles
Browse latest Browse all 22

Created an Open Close Animation, but script wont activate both doors?

$
0
0
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.

Viewing all articles
Browse latest Browse all 22

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>