Collect to Open
Send a message when a key is collected to open one or more doors in range with the same tag.
Object 1 - MP
Asset: Door
Tags: Door
DOOR BEHAVIOR
Triggered by: Message
Trigger (Open):Key.Collected
Object 2 - MP
Asset: Key
COLLECTABLE COMPONENT
Triggered by: Collect (collision)
Send:Key.Collected
Broadcast Type: SpecificTagsInRange βDoor
Range: Adjust as needed*
*Adjust range so any doors to be opened by the key are located within the keyβs yellow sphere. This indicates how far the keyβs message can be sent.
Note
One key can open any door with the tag you choose using this method. You can use this schema multiple times to have multiple keys that only open certain doors for a fun challenge, like a maze.
Collect to Unlock
Instead of opening the door(s) when the key is collected, trigger a toggle component to unlock the door behavior(s), then interact with the door(s) to open. This feels more realistic.
Object 1 - MP
Asset: Door
Tags: Door
DOOR BEHAVIOR
Triggered by: Message
Trigger (Open):Interact
TOGGLE COMPONENT
Triggered by: Message
Trigger (On):Key.Collected
Object 2 - MP
Asset: Key
COLLECTABLE COMPONENT
Triggered by: Collect (collision)
Send:Key.Collected
Broadcast Type: SpecificTagsInRange βDoor
Range: Adjust as needed