Knowledge base
Search Blueprint patterns
Searching…
Knowledge base
Create struct FInventoryItem: {ItemName (Name), ItemCount (int), ItemData (object ref)}.
Variable: Inventory (Array<FInventoryItem>).
AddItem: ForEachLoop(Inventory) → CastTo/Break FInventoryItem → Branch(ItemName==NewItem.Name) → True: Get → Modify Count → Array Set (replace at index) → return. If not found: Make FInventoryItem → Array Add.
RemoveItem: Find by name → Branch(Count>1) → True: decrement → Set at index. Else: Array Remove at index.
Key: Arrays of structs require 'Array Set' with index to modify in place — getting and modifying a copy does NOT update the array.