# Physics Based Door Blueprint does not act Independently when multiple are placed in scene

**URL:** <https://forums.unrealengine.com/t/physics-based-door-blueprint-does-not-act-independently-when-multiple-are-placed-in-scene/1963595>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, question\
**Created:** [August 6, 2024, 2:15am UTC](https://forums.unrealengine.com/t/physics-based-door-blueprint-does-not-act-independently-when-multiple-are-placed-in-scene/1963595 "2024-08-06T02:15:55Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![POTATOGAMER](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@POTATOGAMER](https://forums.unrealengine.com/u/POTATOGAMER)\
**Post date:** [August 6, 2024, 2:15am UTC](https://forums.unrealengine.com/t/physics-based-door-blueprint-does-not-act-independently-when-multiple-are-placed-in-scene/1963595/1 "2024-08-06T02:15:55Z")

</div>

I have a Blueprint for a door which acts much like doors do in the Amnesia games. My issue however, is that I want to place multiple instances of this door blueprint throughout my level but whenever I open one door, they all open.

I also can’t help but feel that there is a more efficient way of going about my code, please let me know of any suggestions that you may have.

**Code Logic from My First Person Blueprint**  
So, my doors opening/closing code is first powered by a line trace (when Left Click is Pressed) from the first Person Character Blueprint to see if it touches a Door or the Physics Door Asset Class

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/c/3/0c352eb8c4ada6e7b392f968cb9e58422cb626b9.png)

When door is being grabbed, the camera freezes, this is the logic for freezing the camera:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/0/c/40c4e6115bcab346400c90a492e4ebf40fd5d6fe.png)

**Code Logic from my Physics Door Blueprint**  
This Blueprint also starts with the left mouse button being pressed and is initiated with the following code

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/3/d/a3d2c85f290094356f06dbe8fcba9d0f70b7dd3d.jpeg)

This pic below is what is what happens after I cast to my First Person Blueprint. This code is how I Turn the door open:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/7/d/57db8d2b810c9eff6880b57936cd61fd7516ff81.jpeg)

The viewport for my door is as follows:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/f/7/0f7597594faeaa571e9a1f25d6e84dde0ea96315.jpeg)  
I have a hinge Physics Constrain which ensure that it can only rotate left and right

Sadly, I cannot currently upload Videos since I am new, but any help that can be provided would Wonderful as I’m still learning UE5.

Thank you everyone in advance for any help you may have!

---

<div class="post-metadata">

**Author:** ![Auran131](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Auran131](https://forums.unrealengine.com/u/Auran131)\
**Post date:** [August 6, 2024, 2:28am UTC](https://forums.unrealengine.com/t/physics-based-door-blueprint-does-not-act-independently-when-multiple-are-placed-in-scene/1963595/2 "2024-08-06T02:28:40Z")

</div>

i cant see everything there so ill give you a few pointers.

1. you wants to use Interfaces (plenty of tutorials on youtube)
2. you want the door logic on the door, you can use a timeline rather than tick
3. dont use GetActorOfClass

simple flow

player presses button  
line trace for actor  
call interface function on actor  
actor function opens door

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [August 6, 2024, 8:19am UTC](https://forums.unrealengine.com/t/physics-based-door-blueprint-does-not-act-independently-when-multiple-are-placed-in-scene/1963595/3 "2024-08-06T08:19:31Z")

</div>

As above but also here’s the entire setup with interfaced doors:

> [@How do I make a Phasmophobia door mechanic](https://forums.unrealengine.com/t/how-do-i-make-a-phasmophobia-door-mechanic/1805515/11):
>
> Yeah, that’d make more sense, fair enough sweat_smile … Rejigged the logic a bit, more robust now: Added a function that determines the direction of the mouse movement in relation to the door’s facing direction: the inner workings the door mesh is attached to the hinge around which it pivots, the mesh is 100uus and offset by half: This step point_up can be omitted and simplified in the Modeling Mode → xForm → Edit Pivot (or have a properly exported m…

---

<div class="post-metadata">

**Author:** ![POTATOGAMER](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@POTATOGAMER](https://forums.unrealengine.com/u/POTATOGAMER)\
**Post date:** [August 7, 2024, 4:33pm UTC](https://forums.unrealengine.com/t/physics-based-door-blueprint-does-not-act-independently-when-multiple-are-placed-in-scene/1963595/4 "2024-08-07T16:33:03Z")

</div>

Hello @Everynone and @Auran131! Thank you for responding to my post so quickly! So I’ve been fiddling around implementing the code and suggestions that you both have provided, but have one hiccup with my implementation.

For my Blueprint, I have Physics Handle-related logic which also relies on my Left Mouse Input. My action Mapping has two triggers; Pressed and Released:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/6/c/76c872661730fbb8bc64b14614cb6e89e8b4eb4c.png)

(I can only have one pic per response so I will have to have quite a few responses 🙄

---

<div class="post-metadata">

**Author:** ![POTATOGAMER](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@POTATOGAMER](https://forums.unrealengine.com/u/POTATOGAMER)\
**Post date:** [August 7, 2024, 4:33pm UTC](https://forums.unrealengine.com/t/physics-based-door-blueprint-does-not-act-independently-when-multiple-are-placed-in-scene/1963595/5 "2024-08-07T16:33:43Z")

</div>

My issue, is that the blueprint example that @Everynone provided has an Input mapping that is constantly firing when the left mouse input is entered.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/3/3/033bb43d8986b67ee2a9e799fabd623936a160c0.png)

Comparatively, my code is only firing once every time I press/release the Left Mouse Button which means it is only rotating the door for one single frame. This problem still exists even when I use the Triggered output on my Action Mapping.

I have tried removing the Triggers on my side which ends up fixing the issue with the doors, but breaks my Physics Handle logic. Still, I am unable to show videos of what is happening now since I am a new user to the forums but will have some of my code’s logic here:

---

<div class="post-metadata">

**Author:** ![POTATOGAMER](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@POTATOGAMER](https://forums.unrealengine.com/u/POTATOGAMER)\
**Post date:** [August 7, 2024, 4:34pm UTC](https://forums.unrealengine.com/t/physics-based-door-blueprint-does-not-act-independently-when-multiple-are-placed-in-scene/1963595/6 "2024-08-07T16:34:27Z")

</div>

To Start, I initialize my logic for picking up objects or opening Doors here:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/0/2/a0282cf5c15ee66b96a783aa51d8edbbc600dae4.jpeg)

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [August 7, 2024, 4:34pm UTC](https://forums.unrealengine.com/t/physics-based-door-blueprint-does-not-act-independently-when-multiple-are-placed-in-scene/1963595/7 "2024-08-07T16:34:48Z")

</div>

How would you like Input to trigger? Once (when pressed / released) or every frame? `Triggered` fires every frame, for example.

* * *

> Physics Handle

Instead of Adding Force, you want to use Physics Handle on the constrained component - is this the ideal scenario? Not sure if that’s the right combo - both components will attempt to constrain the target at the same time. Might be fine, though.

---

<div class="post-metadata">

**Author:** ![POTATOGAMER](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@POTATOGAMER](https://forums.unrealengine.com/u/POTATOGAMER)\
**Post date:** [August 7, 2024, 4:38pm UTC](https://forums.unrealengine.com/t/physics-based-door-blueprint-does-not-act-independently-when-multiple-are-placed-in-scene/1963595/8 "2024-08-07T16:38:24Z")

</div>

It would be preferred if I could have a pressed/released kind of system as it would align with the Physics Handle code I already have for the Left Mouse button.

When it comes to adding force, I am only adding force when throwing objects that I have with my physics handle

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [August 7, 2024, 4:41pm UTC](https://forums.unrealengine.com/t/physics-based-door-blueprint-does-not-act-independently-when-multiple-are-placed-in-scene/1963595/9 "2024-08-07T16:41:47Z")

</div>

Just to clarify, how is it supposed to work in game:

- we approach the door
- press the LMB once and doors fully open?
- or, we grab it with the Physics Handle and manipulate it for as long as the LMB is down? ← judging by the released on cancel.

---

<div class="post-metadata">

**Author:** ![POTATOGAMER](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@POTATOGAMER](https://forums.unrealengine.com/u/POTATOGAMER)\
**Post date:** [August 7, 2024, 4:43pm UTC](https://forums.unrealengine.com/t/physics-based-door-blueprint-does-not-act-independently-when-multiple-are-placed-in-scene/1963595/10 "2024-08-07T16:43:21Z")

</div>

Well, I have an older version of this door where there is no Physics Handle component involved. It is disabled when a door is hit by the line trace and the player simply Adds rotation to the door based on the player’s left/right mouse input.

This is the way I would like it to work 🙂

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [August 7, 2024, 4:50pm UTC](https://forums.unrealengine.com/t/physics-based-door-blueprint-does-not-act-independently-when-multiple-are-placed-in-scene/1963595/11 "2024-08-07T16:50:14Z")

</div>

> [@POTATOGAMER](#):
>
> the player simply Adds rotation to the door based on the player’s left/right mouse input.

So we hold the LMB / RMB down and the door opens closes? No need for a physics handle then, not for the door.

Or, do you _have to_ use it (for whatever reason)?!

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [August 7, 2024, 4:52pm UTC](https://forums.unrealengine.com/t/physics-based-door-blueprint-does-not-act-independently-when-multiple-are-placed-in-scene/1963595/12 "2024-08-07T16:52:52Z")

</div>

So, in short, you want to use input Started / Completed (because other systems require it) but the door should open in a physical fashion.

---

<div class="post-metadata">

**Author:** ![POTATOGAMER](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@POTATOGAMER](https://forums.unrealengine.com/u/POTATOGAMER)\
**Post date:** [August 7, 2024, 4:53pm UTC](https://forums.unrealengine.com/t/physics-based-door-blueprint-does-not-act-independently-when-multiple-are-placed-in-scene/1963595/13 "2024-08-07T16:53:21Z")

</div>

Only the left mouse button being Pressed/Released will control the door. You are correct about the physics handle, there should be no Physics handle involved here haha.

Here is what I was talking about when it comes to the logic that I had for my old door system, I want it to work similar to this (but without those awful casts that I have everywhere lol):

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/f/4/1f4cee6b1139db97147f7f4bfc3f66e5bb4de9d7.jpeg)

---

<div class="post-metadata">

**Author:** ![POTATOGAMER](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@POTATOGAMER](https://forums.unrealengine.com/u/POTATOGAMER)\
**Post date:** [August 7, 2024, 4:55pm UTC](https://forums.unrealengine.com/t/physics-based-door-blueprint-does-not-act-independently-when-multiple-are-placed-in-scene/1963595/14 "2024-08-07T16:55:20Z")

</div>

When you say open in a physical fashion you are referring to the doors physics being simulated correct? Because I would like the doors physics to be simulated whilst being opened/closed or idle.

But yes, it has to be this way since my Physics Handle code needs to be kept this way and is also mapped to the left mouse button

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [August 7, 2024, 5:10pm UTC](https://forums.unrealengine.com/t/physics-based-door-blueprint-does-not-act-independently-when-multiple-are-placed-in-scene/1963595/15 "2024-08-07T17:10:31Z")

</div>

I’d do it like so then:

- the LMB goes down, we send an Interface Message:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/0/8/3088193df1232e9c453dda4090a4c4f4be3198a2.png)

- the door interprets it like so:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/4/1/34132c18997defbae1bcd2646f712bde484a7b12.png)

- optionally, Instead of _gating_ Tick, you could `Enable` / `Disable` Tick
- another option is to increase motor’s target orientation - but this could get fussy / clumsy

* * *

You’d use the same script for the RMB but the bool will be reversed:

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/5/4/c5429a2de2b0b6a43c829f599645739953e0ffc5.png)

The result of using just LMB / RMB:

Does this look about right-ish?

- holding LMB keeps pushing the door
- holding RMB keeps pulling the door
- letting go LMB / RMB lets the door be

Obviously, you’d need to work in direction for the other side of the door, as in the original post.

* * *

> those awful casts

Do note the interface shines here. You can send the same `Interact2` message to any other actor and its job would be to interpret the message for themselves.

---

<div class="post-metadata">

**Author:** ![POTATOGAMER](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@POTATOGAMER](https://forums.unrealengine.com/u/POTATOGAMER)\
**Post date:** [August 7, 2024, 5:21pm UTC](https://forums.unrealengine.com/t/physics-based-door-blueprint-does-not-act-independently-when-multiple-are-placed-in-scene/1963595/16 "2024-08-07T17:21:39Z")

</div>

This is somewhat how I would like it to work. Preferably, the Left mouse button should be responsible for both opening and closing the door and the Right Mouse button should not be used at all for doors (I apologize If I made things confusing earlier, I’m only using the right mouse button to throw objects that have been grabbed by the physics handle logic I have later in my code and has nothing to do with the door)

The Left mouse button should be able to manipulate the rotation of the door by getting the value of the Mouse’s X Direction.

**For example:**  
If the door is selected (By the line trace) after the left mouse button is held down, it should be able to rotate to the left/right based on the value of the mouse moving to the left and to the right. When the left mouse button is released, then the player should have no control over the door.

Thank you! 🙂

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [August 7, 2024, 9:23pm UTC](https://forums.unrealengine.com/t/physics-based-door-blueprint-does-not-act-independently-when-multiple-are-placed-in-scene/1963595/17 "2024-08-07T21:23:36Z")

</div>

> [@POTATOGAMER](#):
>
> The Left mouse button should be able to manipulate the rotation of the door by getting the value of the Mouse’s X Direction.
> 
> **For example:**  
> If the door is selected (By the line trace) after the left mouse button is held down, it should be able to rotate to the left/right based on the value of the mouse moving to the left and to the right. When the left mouse button is released, then the player should have no control over the door.

But this is precisely how my original script works - in the linked thread. It must be updated every frame (triggered) becase we need to sample mouse axis.

---

<div class="post-metadata">

**Author:** ![POTATOGAMER](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@POTATOGAMER](https://forums.unrealengine.com/u/POTATOGAMER)\
**Post date:** [August 7, 2024, 10:07pm UTC](https://forums.unrealengine.com/t/physics-based-door-blueprint-does-not-act-independently-when-multiple-are-placed-in-scene/1963595/18 "2024-08-07T22:07:20Z")

</div>

That is correct. The dilemma that I’m running into is that I would like to use the original script’s code, but It does not work due to the way I have my Input mapping configured with the Pressed/Released Triggers.

I guess what my question is, is do you know any way that I can keep my Pressed/Released Input for interacting with the door? I would like to use the method you have for your script where there are no triggers but it would break the current logic I have for my Physics Handle.

Thanks again for everything!

---

<div class="post-metadata">

**Author:** ![POTATOGAMER](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@POTATOGAMER](https://forums.unrealengine.com/u/POTATOGAMER)\
**Post date:** [August 8, 2024, 2:01am UTC](https://forums.unrealengine.com/t/physics-based-door-blueprint-does-not-act-independently-when-multiple-are-placed-in-scene/1963595/19 "2024-08-08T02:01:47Z")

</div>

Ah Ha!!! After messing about with the code, I now have a solution that works. I used a gate so that I could use the Triggered Execution Pin to be used when connecting to the Door Interface.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/3/b/03ba83938a299cdbcffaec08197ec9ac9f9885ad.jpeg)

I wish that I could show a video to showcase that the script now works but I’m still apparently a “New user”.

But thank you soo much @Everynone! I see why you have the Community Hero Status, I’m not sure I would’ve been able to come this far without your assistance!

In good regards,

POTATOGAMER 🙂

---

<div class="post-metadata">

**Author:** ![POTATOGAMER](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@POTATOGAMER](https://forums.unrealengine.com/u/POTATOGAMER)\
**Post date:** [August 8, 2024, 2:57pm UTC](https://forums.unrealengine.com/t/physics-based-door-blueprint-does-not-act-independently-when-multiple-are-placed-in-scene/1963595/20 "2024-08-08T14:57:06Z")

</div>

Correct 👍🏻 I have since been able to remove the triggers associated with my input mapping for the left mouse button so that the triggered pin will fire continuously. Originally in my script this was not the case.

Now the script is working as intended 😁

[Next page](https://forums.unrealengine.com/t/physics-based-door-blueprint-does-not-act-independently-when-multiple-are-placed-in-scene/1963595.md?page=2)
