# How do I make a Phasmophobia door mechanic

**URL:** <https://forums.unrealengine.com/t/how-do-i-make-a-phasmophobia-door-mechanic/1805515>\
**Category:** Blueprint\
**Tags:** development, doors, unreal-engine, door, Blueprint, question\
**Created:** [April 15, 2024, 10:33pm UTC](https://forums.unrealengine.com/t/how-do-i-make-a-phasmophobia-door-mechanic/1805515 "2024-04-15T22:33:35Z")\
**Posts on this page:** 1\
**Showing post:** 11

<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 18, 2024, 8:56am UTC](https://forums.unrealengine.com/t/how-do-i-make-a-phasmophobia-door-mechanic/1805515/11 "2024-04-18T08:56:05Z")

</div>

> [@Mozillag123](#):
>
> change which way you need to move your mouse for the door to swing open?

Yeah, that’d make more sense, fair enough 😅 …

Rejigged the logic a bit, more robust now:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/2/3/f23aa5302505e1073f5639cc75295fb68102da53.jpeg)

Added a function that determines the direction of the mouse movement in relation to the door’s facing direction:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/6/0/360c4b15e9461657d947e3f8dbf0d45119d9c1db.png)

* * *

> the inner workings

- the door mesh is attached to the hinge around which it pivots, the mesh is 100uus and offset by half:

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

This step ☝ can be omitted and simplified in the `Modeling Mode` → `xForm` → `Edit Pivot` (or have a **properly** exported mesh instead, ofc) where you can set the pivot yourself:

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/6/3/b6372aa1f52a66ccc72216f0999ced413f592384.png)

- the Door `Static Mesh Component` simulates physics; but only when it’s awake and Chaos puts it to sleep quickly:

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

This can be further optimised by detecting the `Wake` / `Sleep` events and disabling the motor in the Physics Constraint component.

- the Physics Constraint component:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/6/b/96ba7d855a56c0606ecf4d780731109df4cf726c.png)

It creates a physical dependency between 2 other components.

- even though we simulate physics, the Physics Constraint component `Locked` the mesh in place:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/9/9/f99ecfb09e00d4a08be0934c9872c89b88583e2b.png)

- it can still swing in one axis, limited and offset - play with those 2 values to see how they affect rotations - they’re relative to the aDoor actor (and yes, you can absolutely make revolving supermarket doors with this):

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/1/f/b1f0160e43ff1f814575369783d6316e85e325d6.png)

- the door has a motor that will try to reach `Swing` velocity of 0 (stop it) with the `Strength 4.0` factor.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/a/4/4a4718ed19332aaf454664462001eb9e8ddb684c.png)

You get quite a bit of flexibility here. This would produce a door that is easy to operate (`Strength 2.0`) but also closes after you (`Strength 3.0`):

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/f/3/4f32447f5293d8c739260d0d61ade092221b4089.png)

Again, massage the values as needed. Some of those settings can (should!) be parametrised and made `Instance Editable` so you can configure each door separately:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/1/a/61a074e4560d1658f5b743fa630c4c038b37f78b.png)

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

Updated project link:

> **[PhantasDoor.zip](https://drive.google.com/file/d/11kjYbyJKmY5PzOSGfBlLocuLrulnbNVN/view?usp=drive_link)**
>
> Google Drive file.

* * *

> a Youtube or a social

No YT and antisocial 😇, and I feel spread thinly already, mostly hang around the forums.

> it works, there are no janky physics

Seems fine at the moment. Knowing life and UE physics, chances are you’ll _eventually_ run into an undesired behaviour. Most kinks can be ironed out, though.

---

_[View the full topic](https://forums.unrealengine.com/t/how-do-i-make-a-phasmophobia-door-mechanic/1805515)._
