> For the complete documentation index, see [llms.txt](https://docs.fullscreen.no/info/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fullscreen.no/info/game-creator-2-assets/inventory-extended/examples/pouch-system.md).

# Pouch System

### Overview

The Pouch example allows items to **store other items inside them**

Since instantiated GameObjects are **not saved by default**, this system uses **pre-made pouch bags** that are assigned dynamically.

***

### Pre-Made Pouches

In the example, pouch bags are already set up in the scene:

**Extended Inventory > Pouches**

* Includes **20 pre-made pouch bags**
* These act as bag instances

#### Adding More Pouches

If you need additional pouches:

1. Duplicate existing pouch GameObjects
2. Regenerate their:
   * **Remember ID**
   * **Local Variables ID**

This ensures each pouch works independently.

***

### How It Works

Each pouch item is linked to one of the pre-made pouch GameObjects using an ID system.

#### On Hover Behavior

When hovering over a pouch item:

**If `Pouch-ID` = 0 (no pouch assigned)**

* A free pre-made pouch is selected
* The GameObject is assigned a unique name (1, 2, 3, etc.)
* The same value is stored in the item's **Pouch-ID** property

**If `Pouch-ID` has a value**

* The corresponding pouch is located
* Its contents are previewed inside the tooltip

***

### Item Setup (Required Properties)

To turn an item into a pouch, add the following properties to the Item asset:

* **Pouch-ID**
  * Default: `0`
  * Assigned automatically via Visual Scripting
* **Pouch-Height**
  * Defines the number of grid rows
* **Pouch-Width**
  * Defines the number of grid slots. If Pouch-Height is 1, and Pouch-Width is 5, there will be 5 slots. If Pouch-Height is 2, there will be 10 slots etc
* **Pouch-Full**
  * Default: `0`
  * Controlled via Visual Scripting

***

### Important Limitation

Unity does not save instantiated GameObjects by default.

This system works around that by:

* Using **pre-existing pouch GameObjects**
* Assigning them dynamically via IDs

#### Optional: Supporting Instantiated Objects

If you want to support saving instantiated GameObjects, you can use **Persistent Instances**.

[Persistent Instances](https://assetstore.unity.com/packages/tools/utilities/persistent-instances-game-creator-2-366144)\
This asset allows runtime-created objects to persist between sessions so spawned GameObjects can be saved and restored when loading a save.


---

# 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://docs.fullscreen.no/info/game-creator-2-assets/inventory-extended/examples/pouch-system.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.
