A key that locks and unlocks doors?

So is there a way to make a key that locks and unlocks a certain door?
Yeah, the post is short but its only ONE question…

Question megathread maybe?

Just to clarify for others, a physical key? or a weapon?

a physbox for the key, a trigger_multiple linked to two logic_relays for the lock, and a filter to only let the “key” engage the lock.

If the key is supposed to be used like a credit card (move it through a trigger to lock/unlock) then you could use a simple trigger_multiple with a filter_name to filter the name of the key (func_physbox or prop_physics) and add the output to lock/unlock the door (an additional logic_branch can help).

If you want to make it stick to the door (so you can’t carry the key and have the door opened at the same time), try a mix of the method above and a plug like in HL2.

Edit: Ninja’d.

A func_physbox is going to be the key.


Could you explain in more detail because I have never used logic_ entities…