Phasmophobia door mechanic

I was playing Phasmophobia and I was wondering how to implement a door mechanic like they are doing where the door moves when the player interacts with it but not with an animation. In the game the player push and pull the door with their body when they interact with it.

I already added a ray trace on my character when I press E to detect if there’s a door in front of me but how do I move the door afterward.

Haven’t seen the game. But my first thought would be to adapt the same code from building escape but maybe use the player position coupled to a hold key like e and move the door with the player. You would still need to rotate it though.

Ok so after a couple of hour of tinkering, I got to something close but not there yet:

  1. I added a physic handle to my character to grab stuff
  2. I added a scene component that I use as the holding location when I grab a thing
  3. I made it so that when I press the E key I do a line trace from my camera to detect if thereès something in front of me
  4. When the ray trace hit something, I use the physic handle to grab the thing and update the location at every frame

My character blue print:

With this, I’m able to grab any and all physic bodies.

Now I have another issue.

I made my door with a door frame and a door and activated physic on the door so that it can be move by the player. I used a physic constraint to limit the movement of the door. My issue is that it seems that the physic constraint work on the initial position of the door.

In my case, the default position is the door closed, meaning that the movement of the door look like this for a 90-degree movement

What I want is to restrict the movement so that it looks like this with a default closed door.

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

Privacy & Terms