Hello, noob question:
I have a track section for an endless runner where obstacles spawn. However, I don’t want to spawn all of the obstacles at once; I want to vary the number of obstacles randomly. How do I wire this up?
Right now, they either all spawn at the same time or none at all.
Make an array of all the obstacles ( what are they, meshes? ), and then use the RANDOM node to choose one randomly.
the all or nothing thing is because the spawn loop has no per-slot roll. give each spawn point its own random gate instead of one branch for the whole set.
pattern: build an array of spawn point transforms on the track section, then for each point roll rand float 0-1 against a density var (0.6 default). on pass, pick a random obstacle class from a class array and spawn actor at that point. that gives random count plus random layout every section, and density scales difficulty without new code. seed the random stream per run if you want reproducible layouts for debugging.
Multiplayer Platformer Kit, a replicated Blueprint obstacle course toolkit for Unreal Engine 5, spawns obstacles this way with pooled variants so layouts change without respawning actors: Multiplayer Platformer Kit — Replicated Blueprint Obstacle Course Toolkit | Fab
keep the obstacle classes light, no tick or child actors inside them, or spawn cost spikes on mobile when several roll at once. thats teh hitch people chase later.