Code that I copied directly does not work.


This code should open the door, and I tried removing the hitbox code but it didn’t work then. Interestingly it also didn’t work when I left it as simply make rotator rotate 90 degrees z axis, in fact I don’t think any code is working on this thing. I have used this exact same code before and it worked fine. No idea what is going on.

Can you try to link the execution line to “Released E”. Pressed is called every frame if you hold the button.

The script is not working for 2 reasons atm:

  • you’ve implemented E in the door - base actors do not process input by default
  • you’re enabling input in the player character (who already has it enabled anyway), not the door

If you must have separate and individual input in every door in the game (why, though?!), enable it for this actor - note it is unnecessary and often a bad idea to handle it like so.


To do it properly, implement input in the character or their controller, and use an interface to communicate player’s will.

sorry, I am literally brand new to blueprint and unreal, this was from a tutorial, this exact code has worked before, but now the door is not moving no matter what I do, could you please explain this very simply?

Disconnect blue wires from Enable / Disable Input targets.


Ideally, find a better tutorial. Search for Door Interface Interaction on YT.

Hey Und3rratetGamer

We are happy to see you here. Asking your questions in early stages of game development is totally normal and a very good habit imo.
Let’s work out your problem. I’ll follow your way of doing this and try to fix it where necessary.
Your code has some problems:

1- You are plugging New Track 0 to make rotator. This is wrong because New Track 0 is supposed to be a variable to control time and not the rotation (We want the door to be opened in a duration of time. That’s why we are using TimeLine node).

2- You are not using a Lerp node. Lerp node is basically in charge of changing a value (in this case the Z rotation value) based on a third value called alpha (in this case it is time stored in form of a float in New Track 0)

3- You are enabling input on the character instead of the door. (As explained above by @Everynone) You are implementing input on the door actor. So, you need to enable input on door actor.

Here’s how to fix these problems:

First make sure your New Track 0 variable is set properly.

Length is the amount of time it takes to open the door. Set it to 1 for now.
Add 2 keys with Add key to CurveFloat.
For one point set both Time and Value to 0.
For the other set both to 1.

Now go back to Event Graph and do the following:
Right Click on New Rotation of the Set Relative Rotation node and choose Split Struct pin so you have access to each axis rotation separately.


Delete Make Rotator node and add a Lerp node. Connect New Track 0 to Alpha pin of Lerp node. Set A to 0 and B to 90. Then connect the return value of Lerp to New Rotation Z (Yaw) of Set Relative Rotation.
. This means over period of time Alpha (Here we set it to 1), Yaw goes from 0 to 90.
You should have something like this:

After that disconnect the wires that go from As BP Third Person Character to target input pin of Enable input (As @Everynone mentioned above). This means now the target is self which is actually the door. So, any input (in my setup is O and in your setup is E) that is implemented on door will now work.

Note make sure the trigger box is greater than the door because you need to enter box area in order to Enable Input. It should look something like this:

With that done, compile and play. Enter trigger area and everything should work fine.

Although this is not a recommended way of doing this (As @Everynone mentioned), learning about why your method did not work will increase your experience.

Have fun!

Not necessarily. Nothing is stopping you from hardcoding Z value right into the timeline. Lerp is just so much clearer and flexible, ofc.

I appreciate the clarification. That is entirely accurate. I think I shouldn’t’ have used the word “wrong” because it is totally doable. In fact, in UE 5.5 Documentations, in opening door tutorial, Lerp node is not used. Here’s a reference to Opening Doors in Unreal Engine | Unreal Engine 5.5 Documentation

Here is a simplified version with no key input event and no casting. Walking into the box area will open the door and it will be closed when player leaves the box area.

2 Likes

Thank you everyone. It works now. This is why I chose unreal.