In this section, we will create a key item. First, we will create a key asset. Right click the mouse in the Unity editor: Create > Fantasy Data > Items > Key.
Once created, you’ll see a list of data that can be edited within the editor, no coding necessary.
Now, we’ll created a key model.
Once you’ve created your key, drag the model into the project window. Your folder/project area should look like the above image. Now, click on your key asset and add the model to the asset. You’ll also want to name the key and add an id for the key.
Once completed, add the KeyItem.cs script to the prefab. (Reminder: make sure you have a prefab of the key out in the scene.)
Now drag the Key asset into the Key Item field. You have officially created your first key for your RPG using our system, congrats!