Locked door
A door only someone holding the key can open. Clicking without the key shows "You need the key" on a sign.
You need
- A key (an object with VRC Pickup)
- The door (clicked) and the door panel to hide
- A sign for the message (TextMeshPro)
The door's trigger
Add a Tripwire Trigger to the door with this variable.
| Name | Type | Sync |
|---|---|---|
| has key | On/Off | Not synced |
WhenInteract⋯
What to do
If⋯
Conditionhas key is On
ThenSet Active⋯
Targets Door Panel
Show Off
Set Text⋯
Targets Sign
Text You need the key
+ Add what to do
The key's trigger
Add a Tripwire Trigger to the key that sets the door's variable when picked up.
WhenOn Pickup⋯
What to do
Set Another Trigger's Variable⋯
TriggerDoor
Its variablehas key
ValueOn
+ Add what to do
The variable isn't synced, so it turns on only for the player who picked up the key, and the door opens only on their screen.
Opening it for everyone
Keep "has key" as it is, and keep the door's state in a separate synced variable: set it under Then, and hide the panel from On Variable Changed, as in A switch everyone shares.