MoonCode Studio

How To Add New Item To Database

Add new data to Items.json file in folder: Resources - Items

{
    "id": 8,
    "name": "Crossbow",
    "price": 10,
    "power": 5,
    "stackable": false
}                                   

Fields in Items.json file must correspond to the fields in “Item” class in InventoryDatabase.cs script

Add new sprite with the name of your new item ID to folder: Resources - Items - Sprites

Set TextureType to “Sprite (2D and UI)“

Create new 3D GameObject with the name of your new item ID

Add “ItemCollectable“ script and set “ItemID“

Don’t forget to set “IsTrigger“ to True in “Collider“ component

Add your new 3D GameObject to folder: Resources - Items - Prefabs