Basically, my problem is that when i get out of the range of the doors, they close, but they dont close all the way, the door has 2 sides and it merges in so it closes, and merges outwards to open, it opens perfectly when im in range, but when it tries to close, sometimes it will close all the way, sometimes (like when i lag) it will close only half way, or leave a little gap inbetween.
How would i fix this?
Heres my simple script attached to the doors:
var openCloseSound : AudioClip;
animation.Stop();
function OnTriggerEnter() {
audio.PlayOneShot(openCloseSound);
animation.Play("open");
}
function OnTriggerExit() {
yield WaitForSeconds (1);
audio.PlayOneShot(openCloseSound);
animation.Play("close");
}
The animations are perfect, and it closes all the way, but sometimes in the game, it wont close all the way ![]()
Thanks for any help.