Treasure Chest
Unlockable chests with rewards.
Introduction
Treasure Chest is an interactive chest that hands its reward straight to the player who opens it, no looting mechanics required. Behind the scenes the chest is claimable exactly once on the server: after the first player claims the reward, the chest is done, and nobody else can claim it. When the chest opens, its reward is collected automatically into the bag (the inventory) of the player who opened it, never into the toolbar. To move the item from the bag into the toolbar, or to add effects around the moment, script the When Treasure Obtained event on the chest. The Treasure Chest component panel in the Uni editor Image The Treasure Chest component panel in the Object editor. caption
How to Access
Select an object, open the Properties Panel, then press the Add Component button at the bottom and pick Treasure Chest. The component stacks onto the object as a new accordion of properties. How to Access - Add Component in the Properties Panel
Another Way to Access
Shortcut: open the Asset Panel, go to the Device tab, Others category, and click the Treasure chest block. The editor spawns a cube with Treasure Chest already attached, ready to adjust. How to Access - the Treasure chest block in Asset Panel > Device > Others
Properties
Reward Asset The prize inside the chest. Model Button The visual look of the chest, closed and opened. Trigger Mode Enum How players open the chest. Interact Text String The label on the interaction bubble. Property Type Description Every property on the Treasure Chest component.
Events
When Treasure Obtained Fires when a player claims the chest reward. Player: the player who claimed the reward Event Description Parameter Every event on the Treasure Chest component. Each event links to its full guide, where its parameters and example live.
Commands
Treasure Chest has no commands.
Example
Open the chest and the reward auto collects to the bag Treasure Chest - Simple Example