Problem with door blueprint

So, to preface this post. I am very new to blueprint and working with Unreal Engine 4. I am 17 and I aim to be a professional game developer. Anyway…

I am trying to replicate the doors from the Hitman games, where after you open the door, it closes automatically after around five seconds. I have it working for the most part, but there is an issue when you open the door, then close it before the delay timer runs out. The door snaps back into the open position, and plays out its animation. Check out this video I whipped up very quickly:

If you have played any of the Hitman games, you should know what I am trying to achieve. So is there a way to fix this with what I currently have, or should I scrap the blueprint and redo it? Thanks.

Your video is private and we cannot view it.

Some screenshots of your BPs would also be helpful to see how exactly your attempting to open/close the door.

Woops, lemme fix that real quick!

hey there,

for me it would be easier to view images instead of videos, because i can look through your bp easier.

I would try to move your Idle logic inside the tick event of the door.

Lets say if you:

  • “open” the door
  • enable tick events for this actor
  • set a boolean “Idle” to true
  • inside the tick -> count the idle time
  • set idle to false in case you do something with the door
  • if idle true, door state is “Open” and idle time expired -> close the door automatically
  • disable tickevents

best regards

The thing about delays is that it you try to revert something after a certain amount of time, and try to do something else before it is finished, it will try to do both things at once. You will need to add another branch after the timer to see if another animation is active. Basically have a bool before the timeline saying that there is an animation active. On finished, make it false. After the delay, check to see if it is still false.

Not sure if this is what you meant, but it worked:

I added “Idle?” as a Boolean, and set it so if the door is open, Idle? = true. If Idle? = false, then it will activate an event tick, preventing the delay timer from running out. Thanks guys.