How can I create a door thats locked on one side and that we can unlock from other side?

Hello there.

I’ve been scratching my head hard on this one and It’s seem easy in theory but I just cant get it to work. I am using the line trace to communicate with the door. But I want it to be locked from one side and I unlock it from the other side with the line trace.

Hope that someone knows the quick fix for that one.


I suggest you to use 2 trigger box and put one on each side of the door. When user come the the door, they will have to enter the trigger box, and depend on which trigger box they enter, they can or can’t open the door.
Or instead of checking mesh overlap with the trigger box, you can use the same basics idea, use 2 trigger box and depend on which trigger box you detect, you can allow the door to be unlocked or not.

Hey thanks for the answer! Ya I ended up coming up with something like that. I’ve put a trigger box on the other side of the door that puts a integer variable to 1 and lets me unlock the door and if i choose not to open the door well as soon as I leave the trigger box the variable is reset to 0. Thanks a lot for the alternative way:) I hope these 2 ways helps out others:)

I know this is three years old, but maybe you could have a door enum like locked, opened, etc. Then, you place the door in your scene and on one side have a trigger volume that when the player character is overlapping it allows you to call a function that changes the door type from locked to unlocked. Then, after the type has been changed you could remove the trigger volume from the scene (maybe) because the door would be unlocked. That way you would only need one trigger.