# How to add a "closed" mechanism for a physics based door

**URL:** <https://forums.unrealengine.com/t/how-to-add-a-closed-mechanism-for-a-physics-based-door/2457492>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, question\
**Created:** [April 15, 2025, 5:23am UTC](https://forums.unrealengine.com/t/how-to-add-a-closed-mechanism-for-a-physics-based-door/2457492 "2025-04-15T05:23:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![SithHunter](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SithHunter](https://forums.unrealengine.com/u/SithHunter)\
**Post date:** [April 15, 2025, 5:23am UTC](https://forums.unrealengine.com/t/how-to-add-a-closed-mechanism-for-a-physics-based-door/2457492/1 "2025-04-15T05:23:43Z")

</div>

I currently have a door that works exactly as I want it to. You can push it with physics, it’s constrained to only open 1 way, has click and drag opening and closing functionality and can be unlocked with the presence of a key.

So far, the only thing I’m missing is a way to have it “click shut” when it reaches the correct rotation so that it stays there until the player clicks on it to move it again.

I’ve come up with a few possible ways to maybe make it work but they seem pretty sloppy. I’m wondering if anyone has any ideas how I could do this efficiently?

EDIT: I didn’t mention what I had come up with but the best solution I’ve thought of is to disable physics when the door reaches a specified rotation and then re-enable it when it is moved more than 1-2 degrees.

---

<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:** [April 15, 2025, 6:29am UTC](https://forums.unrealengine.com/t/how-to-add-a-closed-mechanism-for-a-physics-based-door/2457492/2 "2025-04-15T06:29:45Z")

</div>

> [@SithHunter](#):
>
> the best solution I’ve thought of is to disable physics when the door reaches a specified rotation and then re-enable it when it is moved more than 1-2 degrees.

But then you cannot move it at all since physics is disabled - is this the issue here?

> [@SithHunter](#):
>
> So far, the only thing I’m missing is a way to have it “click shut” when it reaches the correct rotation so that it stays there until the player clicks on it to move it again.

If that’s the case, enabling / disabling physics could / should work. Not sure how you’re driving the door; if you’re using motors, you could set those to hold the doors in place, like in this example:

> [@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:** ![SithHunter](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SithHunter](https://forums.unrealengine.com/u/SithHunter)\
**Post date:** [April 15, 2025, 7:12am UTC](https://forums.unrealengine.com/t/how-to-add-a-closed-mechanism-for-a-physics-based-door/2457492/3 "2025-04-15T07:12:12Z")

</div>

So I went with the Disable / Re-enable Physics option since it was the most logical I could come up with and you thought it was a valid method. Thanks for the feedback

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/7/7/477b466e0be3ff400278dbf0bf104b623ae992ad.png)

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [May 15, 2025, 7:13am UTC](https://forums.unrealengine.com/t/how-to-add-a-closed-mechanism-for-a-physics-based-door/2457492/4 "2025-05-15T07:13:06Z")

</div>

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