Skip to main content

Spawning Random Actors

note

See LV_UseCases in the example map for an implementation.

Overview

Suppose we want to define a list of actors to randomly spawn in a level. We can do this with a loot table template:

Data Table Coins
Row NameActor Class
CopperBP_CoinCopper
SilverBP_CoinSilver
GoldBP_CoinGold
Loot Table Template A (Unlimited)
Row NameRef TableRef Row NameRef ModeWeightWeight Inherit Mode
CopperCoinsCopperRow6000Parent
SilverCoinsSilverRow3000Parent
GoldCoinsGoldRow1000Parent
Loot Table A
Ref TableRef Row NameWeightProbability
CoinsCopper600060%
CoinsSilver300030%
CoinsGold100010%

We can sample from this loot table, get the actor class from the data table, and spawn the actor in the level.