An Attribute View presents one attribute value in the UI. Use it inside an Item Description or comparison panel when the player needs a clear label and value, such as Iron Sword Attack or its current Durability.

Attribute Views are reusable visual prefabs. The attribute name, value type, and source Item must be supplied by the surrounding view or binding.

Before you begin

Confirm that:

  • the intended Inventory System Database is selected in Main Manager > Setup;
  • UI Designer Canvas Managers and a duplicated schema have been created;
  • Spawn In Scene has created the starting UI;
  • an Item Description or other parent view exists for testing; and
  • the source attributes have been declared and assigned values.

For the standard example, declare Attack as an integer Item Definition attribute on Weapon and Durability as an integer Item attribute on Weapon. Set definition values for Iron Sword and Fire Wand, then set each definition’s starting Durability through its Default Item.

Create an Attribute View

  1. Open Tools > Opsive > Ultimate Inventory System > UI Designer and select Attribute View.
  2. In Create, choose the template closest to the intended label-and-value layout.
  3. Create the Attribute View from the duplicated project schema.
  4. In Edit, select the created Attribute View.
  5. Add or remove entries in the Attribute View Modules section. Eligible module types appear in the module dropdown.
  6. Configure each module’s text, image, or other UI reference.
  7. Set the formatting required by the source type, such as the decimal format for a float value.
  8. Save the project-owned prefab and assign it to the Attribute View Set or parent view that will supply the attribute.

Keep one row focused on one value. A compact Attack 12 view is easier to reuse than a single component that also tries to draw the Item name, Icon, price, and selection state.

Choose a module for the value type

Value to display Attribute View Module pattern Standard use
Whole number Value Attribute View Iron Sword Attack or current Durability
Decimal number Float Value Attribute View A project-defined multiplier or duration, with a controlled decimal format
Text Value Attribute View A short string attribute when it belongs in an attribute row
Name and arbitrary value Name Value Attribute View A general labeled row for a supported value type

Value Attribute View converts the supplied value to text and supports integers and strings. Float Value Attribute View requires an Attribute<float> and adds numeric formatting. Name Value Attribute View displays the attribute name and its value together.

Do not choose a module only because its output looks similar. A float module cannot correctly read an integer declaration without an intentional conversion, and a simple text module is not a substitute for dedicated Shop Currency views.

Use Attribute Views in an Item Description

  1. Create the reusable Attribute View prefabs needed by the project, such as Attack Value and Durability Value.
  2. In the Item Description, add or configure a Category Attribute View Set Item View Module.
  3. Map Weapon to the Attribute Views for Attack and Durability.
  4. Map Consumable only to values that apply to Health Potion, or leave the extra attribute area empty.
  5. Confirm that the attribute names use the same spelling and capitalization as their declarations.
  6. Select Health Potion, Iron Sword, and Fire Wand and verify that the parent view supplies the correct attribute to each row.

Health Potion should not show empty Weapon rows. Iron Sword and Fire Wand should use the same Attribute View prefabs while displaying the values from their own definitions and runtime Items.

Choose the presentation style

Comparison-style value

Use a comparison treatment only when the surrounding UI supplies a meaningful reference value. For example, a weapon-selection panel can compare Fire Wand Attack with the currently equipped Iron Sword. Keep the base value readable even when no comparison is available.

A comparison-style Attribute View displaying a value with a distinct comparison treatment.

Themed value

The legacy healing example shows how a label, icon, and value can share one reusable row. Use this pattern only when the project defines a compatible source attribute; the standard Health Potion sample does not require a separate healing field.

A themed Attribute View presenting a healing value with its label and visual treatment.

Match scope to runtime behavior

Attack belongs on the Item Definition when every Iron Sword Item shares the same base value. Durability belongs on the Item when each runtime weapon can change independently. The Attribute View reads the resolved value; it does not decide where that value should live.

When a runtime value changes, refresh or redraw the supplying Item Description and confirm that the Attribute View receives the updated Item value. If two weapons must retain different Durability values, Weapon must be mutable and unique and the declaration must remain in the Item collection.

Decide where to customize

Edit the generated instance when one panel needs a unique row. Edit the project-owned Attribute View prefab when every Item Description using that prefab should change. Edit the corresponding prefab in the duplicated schema when future UI Designer output should start with the customization.

After changing a shared prefab, recheck every Item Description, comparison panel, and tooltip that consumes it. Long labels and large numeric values must still fit at the smallest supported size.

Editor checkpoints

Before entering Play Mode, confirm that:

  • the Attribute View prefab belongs to the project or duplicated schema rather than package assets;
  • every Attribute View Module has its required UI references;
  • the selected module accepts the declared attribute type;
  • numeric format settings show the intended precision without hiding meaningful values;
  • Attack is an integer Item Definition attribute on Weapon;
  • Durability is an integer Item attribute on Weapon;
  • Iron Sword and Fire Wand have intentional source values;
  • the Category Attribute View Set maps Weapon to the Attack and Durability views without giving those rows to Consumable; and
  • the parent Item Description supplies the selected Item and redraws the attribute area.

Verify in Play Mode

  1. Open Bag and select Health Potion. Confirm that no empty Attack or Durability row is shown.
  2. Select Iron Sword and confirm that its Attack and current Durability appear with the intended labels and formatting.
  3. Select Fire Wand and confirm that its own values replace Iron Sword without stale text.
  4. Change one Iron Sword Item’s Durability, refresh or reselect it, and confirm that the Attribute View shows the changed runtime value.
  5. Confirm that another Iron Sword or Fire Wand keeps its own Durability value.
  6. If a comparison view is used, change the comparison target and confirm that both the base value and comparison treatment update.
  7. Select an empty slot and confirm that the parent view clears or hides all attribute rows according to its intended behavior.
  8. Test the longest label and largest expected value at the smallest supported resolution and confirm that neither is clipped.

Troubleshooting

  • The Attribute View tab is unavailable: Check that a database is selected, Canvas Managers were created, a schema was duplicated, and Spawn In Scene completed.
  • An Attribute View Module is missing from the dropdown: Fix compilation errors, then confirm that the component inherits from Attribute View Module or the base View Module type.
  • The row is blank: Check the exact attribute name, declaration scope, source Item value, and module UI references.
  • The wrong Item’s value appears: Check the parent Item Description or comparison binding and confirm that it redraws when selection changes.
  • Health Potion shows Weapon fields: Check the Category Attribute View Set mapping and confirm that Consumable does not inherit from Weapon.
  • Iron Sword has no Durability row: Check that Durability is declared on Weapon’s Item collection, initialized on the Default Item, and requested with an integer-compatible view.
  • Changing one weapon changes every copy: Check that Weapon is mutable and unique and that Durability remains an Item attribute.
  • A float has too many or too few decimal places: Check the Float Value module’s format setting and test zero, negative, and large values.
  • A previous value remains after selection changes: Check the clear behavior of custom modules and confirm that the parent view redraws or removes unused rows.
  • A Currency value is unreadable: Use the dedicated Shop or Currency view rather than a generic Attribute View string representation.

Custom Attribute View Modules

Create a custom module only when the built-in value modules cannot express the visual. The component must inherit from the Attribute View Module base class, or the more general View Module base class when appropriate. After the scripts compile, eligible module types appear in the UI Designer dropdown.

Keep value updates, formatting, and clear behavior deterministic so a reused Attribute View never retains the previous Item’s data.