Skip to content

Inventory Sample

This walkthrough follows a world pickup into the showcase inventory and HUD.

Pickup path

  1. InteractAbility selects ShowcaseInventoryPickup.
  2. Authority calls its Interact implementation.
  3. ItemInstance.TryCreate builds an item from the assigned definition.
  4. CharacterInventory.Layout.Add validates capacity and inserts it.
  5. The pickup sets replicated WasPickedUp and starts a TickTimer.
  6. Rendering hides the mesh and marker until authority resets the pickup.
csharp
if (character.Inventory.Layout.Add(item))
{
    WasPickedUp = true;
    RespawnTimer = TickTimer.CreateFromSeconds(Runner, respawnDelay);
}

The definitions demonstrate three schema families: weapon, consumable, and ammunition. Inspect their required fragments and compare stackable ammo with the individual weapon instance.

ShowcaseHud enumerates the replicated layout and writes each catalog ID into slot0 through slot5. This is deliberately simple; production UI can build reusable slot widgets from the same layout.

Continue with Manual: Inventory and Manual: Equipment.

RedEngine Framework documentation