OK… I’m suddenly getting problems with my door animations and I cant figure why.
Its a simple sliding door with 2 animations, one for open and one for close that activates as the player enters or leaves the ‘trigger’ area. I’m using a simple box collider that’s been extended forwards and backwards around the door, together with a very simple script-
#pragma strict
//Puts Drag n Drop variable slot into Script
var doorClip : AnimationClip;
function Start () {
}
function OnTriggerEnter () {
animation.Play("SlideOpen3"); // Sets name of Animation clip to be played
}
function OnTriggerStay () {
}
function OnTriggerExit () {
animation.Play("SlideClosed3"); // Sets name of Animation clip to be played
}
Everything worked fine until I added extra doors and now the animations play while the player is within the collision box (animations just played on enter and exit before)
Each door has its own animation and own script
At first I had all the doors from a prefab and realised this was changing settings on the other doors so I separated them all into individual parts and reset the scripts and animations.
Now that’s when the problem started, I’m guessing I don’t have a setting correct but cant see what is wrong?
An easier way for me to put it I think is that the close door animation is playing whenever I move within the collision box (not just on exiting the box as it should)
Thanks guys (or ladies)