> For the complete documentation index, see [llms.txt](https://malbersanimations.gitbook.io/animal-controller/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://malbersanimations.gitbook.io/animal-controller/basic-setup-instructions/creating-a-new-item.md).

# Creating a new Item

<figure><img src="/files/UdVdd4RXLxvOBx3kV8Ze" alt=""><figcaption></figcaption></figure>

## Setting up the Scriptable Object

Creating a new item is also incredibly simple.

The items all use Scriptable Objects to hold the data for the items such as:&#x20;

* **ID** - Unique ID Number (**MUST BE UNIQUE FOR THE SAVE SYSTEM TO WORK**)
* **Name** - Name of the Item
* **Rarity** - Rarity of the Item
* **Not Sellable** - Used typically for Quest/Key Items
* **Sell Value** - What is the item worth in the world when selling?
* **Type** - The type of item - See the[ **Setting up Item/Inventory Types**](/animal-controller/basic-setup-instructions/setting-up-item-inventory-types.md) for more information
* **Sub-Type** - The Sub-Type of the item.
* **Icon** - The Icon used
* **Description** - The Description of the Item
* **Subtitle Text** - The Subtitle Text
* **In World Prefab** - The Prefab used when dropping an item back into the world

Those are the basic parameters for an item.\
\
Other parameters include:

* **Stackable** - Is the item Stackable?
  * **Max Stacks** - How many can a stack hold?
* **Equippable** - Is the item Equippable - YES for Weapons, NO for everything else
* **Usable** - Is the item Usable e.g. For herbs, or apples to eat etc.
* **Droppable** - Is the item droppable into the world? If yes, make sure you have an In World Prefab set.
* **Discardable/Deletable** - Is the item discardable e.g. Can the item simply be deleted and removed from the game?

To create a new item, do the following:

\
Right-Click in your folder structure where you want to create the items, then Create ->Malbers Inventory -> New Item<br>

<figure><img src="/files/2OY2RscOV86b3aTv6GJc" alt=""><figcaption></figcaption></figure>

When you create a new item, you'll need to set up it's parameters like the screenshot at the top of the page.

Make sure everything is filled in and especially that the ID of the item is unique.<br>

## Setting up the In World Prefab

The in-world prefab is used for when picking up the item, and dropping the item. The prefab is what you interact with to pick up, and what gets instantiated and dropped when dropping from the inventory.

By default, you may not have any prefabs ready to go although some are included such as an Axe, Sword, Meat etc.

In order to set up a prefab, it's always best to refer to one of the examples so that you don't miss anything but in general, all you need on the item is a pickable component and to add an Inventory Item component.

For the pickable component, you can refer to other tutorials in how to set this up correctly, but as an example:<br>

<figure><img src="/files/PIwH6VZyVjpTBDl9nErR" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
**It's important that for items that aren't persistent in the world e.g. an apple, or a fish etc you set Collectable and Destroy Collectable as TRUE/ON.**
{% endhint %}

By setting those settings to TRUE/ON this will make sure they are collectable and will destroy the in world prefab when collected.

If your item does not have an Inventory Item component, add one. Next, on the Inventory Item component, you will drag in your item scriptable object, to the Inventory Item reference, and set the quantity that you want to give. For most cases, and especially weapons, set this to 1.

<figure><img src="/files/Kj9SSxKXQRQ7EOZMj8T5" alt=""><figcaption></figcaption></figure>

Set the Gameobject Layer of your new Prefab item to "Item" and then drag it into the scriptable objects In World Prefab reference, as stated above.

The final task is to register the item with the InventoryMaster (Order does not matter!)

<figure><img src="/files/uKiUT3V9qTqLtT8SAi4C" alt=""><figcaption></figcaption></figure>

And that's it - you are now ready to pick up items!

{% hint style="warning" %}
**Note - if you are setting up Weapons - ensure you set up those items according to the Weapons tutorial on Youtube here to be able to Equip/Unequip as well as the steps above:** [**https://www.youtube.com/watch?v=6iBFcfE7QI0**](https://www.youtube.com/watch?v=6iBFcfE7QI0)
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://malbersanimations.gitbook.io/animal-controller/basic-setup-instructions/creating-a-new-item.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
