Help with getting door to close after a few seconds from opening

Hi

I’m having problems with getting a door to close again after being open for a few seconds. It sounds like something that should be super easy to achieve, but I’ve not been having much luck. In the course I’m following, the door will open once I have the right keycard. At some point (unless I struggle with getting that to work too :sweat_smile:) I’ll add the option to have to press a key on the keyboard to open the door, just like in the original Doom game.
I’ve checked various forum posts online about how to get a door to close again, but it just won’t do it. It’ll raise using a Timeline, but whenever I try to get it to Reverse, it just continuously raises up and up. I’ve also tried adding a Boolean and a Branch to check if the door is already open before reversing the animation.
The modifications to my Blueprints haven’t been saved whilst experimenting, so it’s all as it is from the course I’ve been following.





Thanks

I did not look into your blueprints, however this is how i would do it:

  • create animation that opens/closes door
  • create two events OPEN and CLOSE. in those events play animation normal direction to open, reverse to close

from trigger volume around door or other way to interact with it, fire OPEN event to open. Then use DELAY node and fire close event

But then you probably want way to force door opening while it is closing or start closing when open anim is playing. Or wait until player leaves door area. For such cases i personally prefer interpto nodes, easier to swap states (just change target values). With animation playing you have kind of messy situation when to change anim direction, pause it etc.

1 Like

Pretty straight forward process here.

1 Like

This looks ideal and makes complete sense. At least with having Vector variables I can control the exact amount of units it moves to. :slight_smile: However, now, the door just… disappears. o_O I’ve temporarily disconnected the reverse nodes whilst trying to get the door to open correctly. Maybe it needs to be converted from Vector to Float? I tried setting the Z axis of Opened Location to 15, but it still disappears.

I’ve also tried mixing your setup with my original, and whilst the door opens correctly, it still doesn’t close. In fact, if I keep walking under the door, it continues to go up. Which doesn’t make sense because wouldn’t the trigger/collision be going up with it…? Or does that stay behind? If it stays behind, that would make sense.

I figured out, from the setup I made based on the course I’m following, why the door kept going up instead of down. It was due to this part:

It was constantly making it go up 15 units every time. :crazy_face:

Okay. Finally got it. :smiley: I guess my value of 15 for a Vector is waaaaay too small. :sweat_smile: So putting something like 300-400 did the trick. Not to mention I may have connected the Opened and Closed Location variables in the wrong slots. :grimacing: :sweat_smile: So thank you for your setup!

The next challenge now is getting it to only open if I press an action key when at the door with the key card.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.