How can I stop my spawned obstacles to stop overlapping with each other? Like I am spawning different type of obstacles for my endless runner using arrow component but when the longer obstacles spawn they overlap with other obstacle of next tile how do I stop this from happening?
overlap like that is almost always the tile not knowing how long each obstacle really is. arrows mark spawn points but a long obstacle extends past its point into the next tile slot, so two lengths collide.
fix: give each obstacle row a length value (its bounds box x size), and when the tile builds, advance the next spawn point by the previous obstacle length plus a gap instead of a fixed step. that way short and long pieces both fit without touching.
Multiplayer Platformer Kit, a replicated Blueprint obstacle course toolkit for Unreal Engine 5, spawns variants this way with pooled slots sized per piece so layouts change without overlap: Multiplayer Platformer Kit — Replicated Blueprint Obstacle Course Toolkit | Fab
also worth clamping the random pick per tile to one long piece max, two longs back to back still crowd even with spacing, its the density that kills it.