Help with Amnesia-style door system

Hello guys, I need some help. I’m a beginner, and I’m trying to create an Amnesia-style door system. I’ve tried several different ways of doing this, like simply rotating the door with the mouse position, which works but causes a lot of issues when interacting with the door from different positions (inverted mouse). Also, opening the door by moving the mouse only horizontally or vertically isn’t as realistic as I’d like.

So, I’ve been working on a different approach to solve these issues. Basically, I detect when the door is being interacted with and save the impact point. I use this as the origin of a line trace, with the final position determined by the mouse values in a local system so that, regardless of where the interaction happens, the axes align with the player (up is always up, down, etc.). This way, an XY trace is created that is directed by the mouse. From there, I’ve tried countless methods to apply rotation in the direction of the trace, but nothing seems to work. How can I apply a rotation to the door in the direction of this trace? Is there an easier way to make this door system?

vid

Check this thread out:

The project is attached.

1 Like