ULootComponent is the runtime piece that actually rolls a LootTable and returns/creates items.
You typically add it to:
- Chests
- Enemies
- Resource nodes (trees, rocks, ore veins)
- Any “loot source” actor in your game
Adding to Actors
Blueprint- Open your Actor Blueprint (Chest, Enemy, Resource Node, etc.)
- Add Component → Loot Component
- Configure in details:
-
Loot Table:LT_YourLootTable -
Single Use:trueorfalse -
Minimum Rarity:Noneor a specific tag -
Item Level:1(or your scaling level) -
Auto Detect Level:true/false- If true, reads a level property from the owning actor (e.g.
CharacterLevel)
- If true, reads a level property from the owning actor (e.g.
Generating Loot
GenerateLoot rolls the table and returns an FLootResult.
Blueprint
- Iterate
Loot Result.Spawned Items - Add each item to inventory, or
- Spawn
WorldItemActorin the world
Checking / Resetting Loot State
Has Been Looted?Has Been Looted node on LootComponent.
Reset Loot
For respawnable containers/nodes:
- Blueprint:
Reset Lootnode - C++:
LootComponent->ResetLoot();
GenerateLoot call re-rolls the table.