Redirect to the Docs main page.Docs

Items

Creating a Container Item

Guide on how to create a container item that can hold other items in Ultimate Grid Inventory.

Creating Container Items

Container items are special inventory objects that can hold other items within them, such as backpacks, chests, or pouches. They function like regular items but have the added capability of storing their own inventory of items.

What is a Container Item?

A container item:

  • Can be placed in your main inventory like any other item
  • Contains its own inventory grid when opened
  • Allows players to store additional items inside it
  • Effectively increases the total storage capacity of your inventory system

Creating a Container Item in Unity

To create a container item:

  1. In the Project window, right-click in your desired folder
  2. Navigate to Create > Inventory > Items > New Item Container

Creating an Item Container through UGI MenuLoading image

Configuring Container Properties

Container items share most properties with standard items. For the basic properties like Display Name, Description, Icon, etc., refer to the Creating an Item documentation.

The key difference is the additional Container Grids property:

Container Grids property in the Container Data SOLoading image

Container Settings

  • Container Grids: This array holds references to grid prefabs that define the internal storage space of your container. Each grid represents a separate storage compartment or tab within the container.

Setting Up Container Grids

Before your container item will function properly, you need to create and configure its internal grid(s):

  1. Create a grid prefab following the guide: Creating Container Grids
  2. Assign the grid prefab(s) to the Container Grids array in your container item
  3. Configure the dimensions and properties of each grid to determine how many items it can hold

Next Steps

After creating your container item:

  • Test opening and closing the container in play mode
  • Configure the visual appearance of the container window
  • Set up item filtering if you want to restrict what can be stored in the container
  • Consider implementing container-specific interactions (like locking/unlocking)
  • Set up the Save System to persist container contents between game sessions

Container items add depth to your inventory system by allowing players to organize their items in meaningful ways and expand their storage capacity through gameplay.

On this page