/Public/Items/WorldItemActor.h
Core Properties
Typical fields onAWorldItemActor:
FItemInstance ItemInstance– The item being representedbool bIsInfinite– If true, can be picked up repeatedlyfloat DespawnTime– Auto-despawn after N seconds (0 = never)UStaticMeshComponent* MeshComponent– The visual mesh
Creating World Items
Method 1: Place in Level (Preconfigured)- Drag WorldItemActor into the level
- In Details:
Pickup Logic
When the player interacts with aWorldItemActor, it should try to add the item to their inventory.
C++ Example (OnInteract)