AWorldItemActor Location: /Public/Items/WorldItemActor.h
Key Properties
- Drag
WorldItemActorinto level - Set
ItemInstanceproperties manually - Or call
InitializeFromInstance()with a pre-made instance
- Demo/tutorial items
- Respawning resource nodes
- Testing
Inventory Items
Inventory Items areFItemInstance structures stored inside InventoryComponent. They have no physical presence until spawned.
Lifecycle
- Pickup: WorldItemActor → FItemInstance (added to inventory)
- Storage: FItemInstance exists in InventoryComponent
- Drop: FItemInstance → WorldItemActor (spawned in world)
| Aspect | World Item | Inventory Item |
|---|---|---|
| Type | Actor (AWorldItemActor) | Struct (FItemInstance) |
| Visible | Yes, in game world | No, UI only |
| Performance | Each is an actor (expensive) | Lightweight struct |
| Interaction | Raycast to pick up | UI interaction |
| Persistence | Saved as actor | Saved in inventory |
Transitioning Between States
World → Inventory (Pickup)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
- Preferred for storage (lightweight)
- Use for player inventory, containers, vendors
- Batch operations when possible
- Validate before adding
Container Items
Containers (chests, boxes, etc.) useInventoryComponent to store items:
- Player UI shows the chest’s InventoryComponent
- Player can transfer items between their inventory and the chest
- 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