Door closing sound plays even if the door wasn’t opened

Hi everyone,
I’m a beginner in Unreal Engine and I’m having some trouble with my door Blueprint logic.

Here’s what I have:

  • The door opens when the player looks at it using a line trace.

  • The door closes automatically when the player leaves the trigger box.

The problem is with the sounds:
The opening sound works perfectly, but the closing sound plays even if the player never opened the door — it just triggers when the player walks out of the box.

How can I fix this so that the closing sound only plays if the door was actually open?

I’ve attached a screenshot of my Blueprint below for reference.
Any help or advice would be greatly appreciated! :folded_hands:

Thanks in advance!

Have you checked the default value of Door Open?

Personally I would add a variable to track the direction of the timeline playback and use that to decide if you are playing the opening or closing door sound. (promote Direction to variable)

How do I do this? This is my first project, so I don’t really understand anything.

Doors can get rather complicated. Right now your door only rotates in one direction. It will always rotate this way so if the character is on the side of the door and it open in on the character you will have him be pushed by the door or it will collide with the camera causing problems.

I would suggest following this tutorial that lerps the door rotation depending on the characters location relative to the door

External link not made by epic games (youtube tutorial)

You can cache the direction of the timeline to a variable like this:

right click Direction

Promote to variable

You can use this information to know if the door is opening or clossing