Items
The item-related mechanics include Collectable Item, Inspectable Item, Openable Box and Item, and Draggable Item.
Let's take Collectable Item as an example. This smart asset enables an object in the scene to become an collectible.
The Collectable Item offers built-in gameplay logic, and you can conveniently modify its attributes through the Behavior component in the properties window such as the Icon. For more information about this smart asset, see Collectable Item.
In our example, we want to make a key a collectible. Here's how we do this:
-
Open the Packages window. Go to the Prefabs section, then drag and drop the Collectable Item into the scene.
-
In the Scene Explorer window, to view the hierarchy of the smart asset, what we need to do is replace the existing model in the collectable item and see if we need to adjust any other settings.
-
Select the model rust_key from the Basic category of Horror Asset in Asset Box and add it to the scene.
-
Drag this model into the [Pivot]Collectable Item folder and disable the existing model named [Model]headusOBJexport.
-
Open the properties window of the Collectable Item. Locate the Behavior component and replace the current UI icon with an IconKey.
Then in Play Mode, this key becomes a collectible in the scene: