Skip to main content
World Items are physical actors placed in or spawned into the game world that players can see and interact with. Class: AWorldItemActor Location: /Public/Items/WorldItemActor.h Key Properties
Creating World Items Method 1: Place in Level
  1. Drag WorldItemActor into level
  2. Set ItemInstance properties manually
  3. Or call InitializeFromInstance() with a pre-made instance
Method 2: Spawn from Code
Method 3: Drop from Inventory
Despawn Timer
Useful for preventing world clutter in survival games. Infinite Pickup
The item can be picked up repeatedly without being destroyed. Useful for:
  • Demo/tutorial items
  • Respawning resource nodes
  • Testing

Inventory Items

Inventory Items are FItemInstance structures stored inside InventoryComponent. They have no physical presence until spawned. Lifecycle
  1. Pickup: WorldItemActor → FItemInstance (added to inventory)
  2. Storage: FItemInstance exists in InventoryComponent
  3. Drop: FItemInstance → WorldItemActor (spawned in world)
Key Difference

Transitioning Between States

World → Inventory (Pickup)
Inventory → World (Drop)

Best Practices

World Items:
  • Use sparingly (each is an actor)
  • Set despawn timers in survival games
  • Use object pooling for frequently spawned items
  • Consider LOD for distant items
Inventory Items:
  • Preferred for storage (lightweight)
  • Use for player inventory, containers, vendors
  • Batch operations when possible
  • Validate before adding

Container Items

Containers (chests, boxes, etc.) use InventoryComponent to store items:
When a player opens a chest:
  1. Player UI shows the chest’s InventoryComponent
  2. Player can transfer items between their inventory and the chest
  3. Items remain as FItemInstance throughout (no world spawning needed)

Summary

  • Item IDs uniquely identify item types
  • ItemDataAsset defines what an item type is (the template)
  • FItemInstance represents a specific instance with unique properties
  • Stacking Policies control how items merge based on their characteristics
  • World Items are physical actors in the world
  • Inventory Items are lightweight structs stored in components