Door swing with a trigger question

Hi,
I have a “WoodenGate” in a hierarchy like this:

  • WoodenGate (Mesh with a mesh collider)

  • doorOpenColliderTrigger (GameObject/3D Object/ Cube with the Activatetrigger script Component)

  • door (Mesh with a box collider)

I also have the standard FPSController in the scene.

My problem is that the opening door animation keeps playing in loop, before my player hits the trigger(doorOpenColliderTrigger).
I am missing something very simple here…

Thanks for any help!

LAOMUISC ARTS

Not really a lot of information to work with…
Are you using the animator or animation? If it’s the animator, do you have transitions setup correctly?
If it’s animation, did you tell it to play in a script or the inspector?

Is there any code related to this that may be causing the problem?

I am using keyframe animation (Window/Animation).
The only script in play is Unit´s Activatetrigger [doorOpenColliderTrigger (GameObject/3D Object/ Cube with the Activatetrigger script Component)].

But you’re saying that the animation just plays all the time?

“My problem is that the opening door animation keeps playing in loop, before my player hits the trigger(doorOpenColliderTrigger).”

Sorry, either the door is colliding with the wrong object to cause the animation, maybe… or the animation is set to loop is all I can think of.

That´s the point: where do I turn the loop off?

Okay, so I’m just guessing your setup is like this… if not, you could alter it, I guess.
I think maybe I found what’s happening to you.
If I add a simple animation (just moves right + 3 units , for a cube) and I put it in the animator, it’s the default animation.
That means, it just plays on entry… I cannot even move the cube anywhere, b/c it’s always setting it to that value.
So, I made a second animation or whatever… just set it to position 0 (start).
Then, I added a transition based on bool or trigger… either would work. And that condition had to be met for the cube to move. This way, it’s not always playing. It just does the transition on bool change or trigger activation.
note: with a bool, i could turn it false & return its position back to the original, which may be useful for a door.

Anyways, hope that helps… sorry for the bit of confusion - I hope this post makes sense & you can implement it.