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.
But then you cannot move it at all since physics is disabled - is this the issue here?
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:
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