Null Bolt
Studio
guides

Items & the Item Creator

Items are plain ScriptableObjects. Author them in the Item Creator window with a live tooltip preview, or straight in the inspector with a click-to-paint footprint editor.

The ItemData asset

One ItemData asset defines what an item is; every copy that sits in an inventory is an ItemInstance pointing back at it. Create one via AssetsCreateInventory SystemItem Data — or use the Item Creator below, which fills in everything correctly.

FieldTypeDescription
Item NamestringDisplay name shown in tooltips and logs.
DescriptionstringLong-form tooltip body text.
IconSpriteSquare-canvas sprite with transparency; rendered aspect-preserved inside the footprint.
Item IDintUnique, non-negative identifier. Save files store only this ID — duplicates silently break loading.
Width / HeightintGrid footprint in cells (e.g. 2×4 two-hander). Minimum 1×1.
Can RotateboolAllows 90° right-click rotation in grids. Mutually exclusive with Stackable.
Stackable / Max Stack Sizebool / intSame-ID items merge on drop up to Max Stack Size. Mutually exclusive with Can Rotate.
CategoryenumOne of Weapon, Armor, Consumable, Tool, Misc, QuestItem.
RarityenumOne of Common, Rare, Epic, Legendary, Unique — drives the item's background tint and aura.
Is Equippable / Equip Slotbool / enumMarks the item for equipment panels and picks its target slot type (Helm, MainHand, Ring1…).
// heads up
Rotatable XOR stackable. An item can rotate or stack, never both — the inspector auto-disables stacking (with a console warning) if both get switched on. And keep Item IDs unique: on load, Resources.LoadAll returns whichever duplicate it finds first. The Item Browser flags collisions in red.

The Item Creator window

WindowNullBoltInventory SystemItem Tools opens the Item Creator and Item Browser docked together as one workspace. The Creator is a single form — name, description, icon, footprint, category, rarity, a Plain/Stackable/Rotatable behavior toggle, and equipment settings — with a live preview on the right that renders the item tile and its tooltip card using the exact same code the runtime uses. What you see in the preview is what players see in Play mode.

Item Creator window with the form on the left and live item + tooltip preview on the right
Item Creator — the ID is assigned automatically (highest existing ID + 1), and the preview updates as you type.

Worth knowing:

BehaviorDescription
Auto IDNew items get the next free project-wide ID automatically — no collision bookkeeping.
ValidationCreation blocks on an empty name or an equippable item with no slot; it warns (without blocking) on a missing icon or an icon whose aspect fights the footprint ratio.
Output folderDefaults to the asset's Resources/Items folder, so new items are immediately visible to save/load and the demo item pools.
Item Generator importIf our Item Generator System asset is installed, an import row appears: drop a generated item in, hit Load Into Form, and the fields pre-fill (rarity mapped, footprint suggested from the icon). The row is hidden when the other asset isn't present.

The Item Browser

The Browser tab lists every ItemData in the project with search, category/rarity filters, and sortable columns. Select several rows (Ctrl/Shift-click) and the bulk-edit panel appears — set rarity, category, or stacking across the whole selection in one undoable step. Duplicate (N) copies items and assigns each copy a fresh, non-colliding ID.

Item Browser window listing sample items with rarity swatches and filters
Item Browser — ID collisions are tinted red, equippables get a green badge, double-click pings the asset.

Custom footprint shapes

The ItemData inspector draws the footprint as a click-to-paint grid — Fill All, Clear All, and Invert included. Painted shapes feed GetShape() and the occupied-cell count.

ItemData inspector with the click-to-paint footprint grid
The footprint editor in the ItemData inspector. Green cells are filled.
// note
Collision is rectangular. Placement and overlap checks use the full Width×Height rectangle, not the painted mask — an L-shaped paint job still collides as a solid block. Treat custom shapes as visual/data metadata, not Tetris packing.

Rarity colors

Rarity tints come from a palette asset, not hardcoded values. Defaults: Common is light gray, Rare blue, Epic purple, Legendary orange-gold, Unique red. To restyle them, create a palette via AssetsCreateInventory SystemRarity Palette and either assign it to RarityPaletteSO.Current at startup or drop a RarityPaletteApplier component into the scene and point it at your palette — the bundled RarityPalette_PixelDark is applied that way in the demo scenes.

Applying a palette from code
C#
using InventorySystem;

[SerializeField] private RarityPaletteSO myPalette;

void Awake()
{
    RarityPaletteSO.Current = myPalette;   // null = built-in defaults
}

Runtime item state

Per-instance state lives on ItemInstance: Position, StackCount, IsRotated, a Condition float (0–1, for durability systems), and a CustomName (falls back to the ItemData name when empty). All of it persists through save/load.

Durability + naming example
C#
ItemInstance blade = inventory.GetItemAt(new Vector2Int(0, 0));

blade.SetCondition(0.42f);              // clamped to 0..1
blade.SetCustomName("Greatsword of Ash");
blade.OnInstanceChanged += i => RefreshTooltipUI(i);

The 22 sample items

Two ready-made sets ship under Resources/Items/: a 13-piece fantasy set (IDs 1–13 — swords, bows, potions, boots, rings) and a 9-piece tactical set in Items/Tactical/ (IDs 14–22 — rifles, magazines, rations… and one Legendary Toilet Paper). They're normal ItemData assets — duplicate and reskin them freely, or use them as footprint references. IDs 1–22 are taken; the Item Creator starts yours at 23.