Use an Item Slot Collection for fixed, ordered Equipment, hotbar or pouch slots. An Item Slot Set defines slot names, order and accepted Item Categories. The collection owns runtime stacks; a UI view and Equipper can share the same set.

In this example, Bag holds an unequipped Iron Sword and Equipment has a Weapon slot. Iron Sword inherits Weapon; Health Potion belongs to Consumable.

Define the slots

  1. Choose Create > Ultimate Inventory System > Inventory > Item Slot Set. Name it PlayerEquipmentItemSlotSet.
  2. In its Inspector, select the scene’s Inventory System Database.
  3. Add an Item Slot Set entry named Weapon with Item Category: Weapon.
  4. Add only the other required slots, such as Head or Chest. Give each a unique name and a valid category from the active database.
  5. Set the intended display and save order before release. Name lookups use the first match.

Category matching includes descendants: Weapon accepts Iron Sword and rejects Health Potion. Each set entry supplies one slot; use an Inventory restriction to limit the amount inside a common Item stack.

The legacy Version 1 Item Slot Set Inspector showing the database, ordered Right Hand, Head, Chest, and Legs slots, and the selected Right Hand slot restricted to the Weapons category.

Configure Equipment

Select or add the Inventory’s Equipment row:

Inspector field Configuration Purpose
Name Equipment Unique collection lookup.
Collection Type Item Slot Collection Store stacks in ordered slots.
Purpose Equipped Identify the equipped collection.
Item Slot Set PlayerEquipmentItemSlotSet Share category and position definitions.
New Item Priority Off by default Keep an occupied unique Item when another is added directly. Enable for deliberate direct replacement.
Try Give Previous Item To New Item Collection Off by default When enabled, offer a replaced Item to the source collection carried by the incoming ItemInfo.
Item Amounts Empty, or intended initial equipment Configure starting Items.

The legacy image shows New Item Priority enabled; choose it according to the intended replacement policy.

The legacy Version 1 Equipment Item Slot Collection with Purpose set to Equipped, an Item Slot Set assigned, New Item Priority enabled, Try Give Previous Item To New Item Collection disabled, and no default Item Amounts.

Select slots and capacity

Automatic AddItem(itemInfo) considers matching slot categories, reuses a stackable common Item slot, otherwise chooses the first empty matching slot, then the last matching occupied slot as a replacement candidate. New Item Priority controls direct replacement of occupied unique Items.

CanAddItem combines slot eligibility, active-database validity and Inventory restrictions. Require a non-null result with the full Amount for an exact transfer. Common stacks can contain several Items; mutable unique Items normally use one slot per Item.

For explicit index/name additions, validate the requested slot’s category first: retrieve var slot = ItemSlotSet.GetSlot(index); and require slot.HasValue && slot.Value.Category != null && slot.Value.Category.InherentlyContains(item). Prefer automatic placement when a particular slot is unnecessary.

Additional rule Configure
Limit common Item amounts per stack Item Collection Stack Size Restriction targeting Equipment, with a positive default or StackSizeLimit attribute.
Limit occupied stacks across named collections Item Collection Stack Amount Restriction and explicit Max Stack Amount.
Add a collection-wide allow/deny list Item Collection Category Restriction.

Keep restriction names synchronized with Equipment. See Item Restrictions.

Exchange Items through an Item Action

Configure Move To Collection Item Action on Iron Sword:

  1. Set the first collection to Bag or Purpose: Main, and the second to Equipment or Purpose: Equipped.
  2. Keep the default Equip and Unequip action names.
  3. Invoke Equip from Bag’s UI.

The action checks removal and full destination acceptance for an empty slot or stackable Item. For an occupied-slot exchange, it checks whether the old equipped Item can return to Bag. Before exposing that exchange, also preflight the incoming Item against Equipment’s restrictions and require full acceptance after replacement. It removes the incoming Item before adding it, preserving mutable identity, returns the old equipment, and sends a rejected remainder to the first collection.

Use the integration-specific equip action for the character-controller bridge; see Built-in Item Actions.

Connect UI and character visuals

Create an Item Slot Collection View through UI Designer Equipment. Set its Item Collection ID to Equipment or Equipped and assign the same Item Slot Set as the runtime collection. Keep Set Item View Slot Restrictions and Add View Slot Category Restrictions on; both default to on. Align visible slots one-for-one in set order.

Add Equipper for character visuals, target Equipment, and reuse the same set. Configure the Item’s equipment-prefab attributes through Equipping Items. The Equipper observes Inventory add/remove events; implement game-specific stat effects separately.

Preserve saved positions

For standard UIS saving, add Inventory Saver to the owner and Inventory System Manager Item Saver to the Save System Manager. Slot saving uses ItemsBySlot, including empty entries, and restores saved indices; the manager Item saver preserves mutable/unique Item data.

Keep collection and slot order compatible with released saves, or migrate them before changing layouts. The UCC integration uses Inventory Bridge Saver in place of the standard Inventory Saver. Follow Save System.

Verify equipment

  1. Enter Play Mode. Confirm Equipment begins with the configured defaults.
  2. Equip Iron Sword from Bag. Confirm the same Item occupies Weapon, its UI slot updates and its Equipper visual appears.
  3. Attempt Health Potion and confirm rejection.
  4. Exchange a second sword through the Move To Collection action. Confirm the old sword returns to Bag with its mutable values.
  5. Save, alter equipment and load. Confirm Item values and positional slots return correctly.

Use slot APIs

For a direct move without replacement, select an empty compatible slot, remove from Bag and return any unaccepted amount explicitly. Use this example with Return Overflow off:

var bag = inventory.GetItemCollection("Bag");
var equipment = inventory.GetItemCollection(ItemCollectionPurpose.Equipped)
    as ItemSlotCollection;

var swordDefinition = InventorySystemManager.GetItemDefinition("Iron Sword");
var swordInfo = bag.GetItemInfo(swordDefinition);
if (swordInfo.HasValue) {
    var targetIndex = equipment.GetTargetSlotIndex(swordInfo.Value.Item);
    var targetItem = targetIndex >= 0
        ? equipment.GetItemInfoAtSlot(targetIndex)
        : ItemInfo.None;

    if (targetIndex >= 0 && targetItem.Item == null) {
        var removed = bag.RemoveItem(swordInfo.Value);
        if (removed.Amount > 0) {
            var added = equipment.AddItem(removed);
            if (added.Amount != removed.Amount) {
                bag.AddItem((ItemInfo)(removed.Amount - added.Amount, removed));
            }
        }
    }
}

Query or remove a named slot when its position matters:

var weaponIndex = equipment.ItemSlotSet.GetIndexOf("Weapon");
var weaponInfo = equipment.GetItemInfoAtSlot(weaponIndex);
var actualIndex = equipment.GetItemSlotIndex(weaponInfo.Item);
var potentialIndex = equipment.GetTargetSlotIndex(weaponInfo.Item);

var removedWeapon = equipment.RemoveItemInSlot("Weapon");

ItemsBySlot preserves empty positions. GetAllItemStacks() lists occupied stacks, so use slot APIs for positional indices. SwapItemSlot(firstIndex, secondIndex) exchanges compatible slots.

The collection inherits OnItemCollectionUpdate, OnItemAdded, OnItemRemoved and OnItemAddOverflow, sends EventNames.c_ItemCollection_OnUpdate, and reports additions/removals through the owning Inventory’s normal events. Equipper sends EventNames.c_Equipper_OnChange after visible equipment changes. Register/unregister matching signatures over the same lifecycle; see Events and Item Collections.