Slot
An object that represents a "keyhole". Any defined "key" can unlock it.
Slots get triggered if you place the correct item in them. It can only be occupied by one item at a time.
You can determine the area that will accept the keys by changing the position and scale of the Slot prop. All of the area covered by the Slot white cube can be used by the player to place an item in the slot.
If you're making a door that a player must unlock with a key remember to parent the Slot object to the door, so the key and slot animate with the opening door. Some prop doors already come equipped with a properly set up slot and key (e.g. Victorian door).
Some items can fall into slots if placed or dropped above them, others will fall through slots. To make items fall into slots that normally wouldn't you can give them a slotable parent and hide that inside the actual object. It will lend its slotableness to the child.
Properties
🔸Keys
Here you add each item that will be accepted as the correct key for this slot. Everything can be a key, not just actual key shaped items. Just make sure to not accidentally make your keys static.
Animated items cannot be assigned as keys. Assign them to be keys first, then animate them. This way the key properties will carry over and be retained when it becomes a pickable animation.
🔸Reject Keys
Items you add here will be accepted into the slot, but they will not trigger the slot to give out the Output Value signal. When a slot rejects an incorrect key the slot will send a 0 value to whatever it is connected to
🔸Edit Key Placement
Clicking this button will open a special mode where you will be able to preview and edit the position and rotation of the slot key when placed in the slot.
🔸Output Value
This is the number that will be sent to the lock after the player has placed one of the correct Keys into the slot.
🔸Unlock Success
Determines if the slot stays usable after being activated once.
🔸Unlock Success Key
Decides what happens with the correct key after it activated the slot:
Merge
means that it will become a static part of the slot, you can not pick it up anymore.Parent
means that the key will stay in the slot and move with it, but it can be picked up again.Eject
will put the key right back into the player inventory after the activation process/animation.
If you have several single use keys in your room, it is advisable to simply merge them to the slot after success to avoid inventory clutter or confusion.
🔸Unlock Failed Key
The same as with success key.
Make sure to not accidentally make false keys merge, else it will prevent the slot from accepting the correct key.
🔸Animation Type
Here you can decide if you want your item to spin like a key, or to do nothing like a properly placed statue or book. Turn Duration and Turn Count determine the turning animation further. You can also make the turn be less than one! This can create lever-like effects sometimes or other interesting stuff. I use less-than-one turn effects in combination with further animation, so that for example a writing pen has a more complex animation consisting of two different movements.
🔸Turn Duration
The turn time in seconds for each turn of the Rotate Key animation. For example, if the Turn count is set to 2 and the Turn duration is set to 2.5, when the correct key is placed in the slot it will make 2 full turns that each lasts for 2.5 seconds. Meaning the animation will end after 5 seconds.
Reject keys will only finish about half of the animation and then return back to the starting position.
Only visible when the Animation type is not set to None
The Turn Axis also influences the duration and rotation amount of the key. If you're having issues timing them try setting only one of the axis to exactly 1.
🔸Turn Count
How many 360 turns should the key make when rotating.
Only visible when the Animation type is not set to None
🔸Turn Axis
Will determine how your key turns. Make sure to test this! Because the default axis makes some of the actual key assets spin sideways!
Only visible when the Animation type is not set to None
🔸Only Usable In Zoom
If checked, this slot can only be activated by the player if the player is zoomed in on the parent, whether that is a pickable object or a prop with the Zoomable behaviour.
If not checked, the player can place items in this slot while not in zoom mode (while walking around the room).
If you check this make sure the slot is a child of the pickable/zoomable.
🔸On Place
If the correct key is placed in the slot, the slot will activate/send the Output Value to the items you link here.
If the reject key is removed from the slot, the slot will activate/send a 0 to the items you link here.
If the slot is not activating as soon as you place an item but you're not using an Animation try setting the Turn duration/count to 0.
🔸On Remove
If a key or a Reject key is removed from the slot, the slot will activate/send the Output Value to the items you link here.