Spawn Blocks at Random X and Z Location

Hey Guys, im doing a simple 2d endless runner game. The endless spawning process is doing fine but i just can’t get the random location thing to work.
What i want is that my tiles are spawning in a random in range X and Z position. Where and how do i implement this?
I reverted all BP´s to the starting state before my endless fails :slight_smile:

Just like in the endless runner tutorial i made a attach point at my Block where further Blocks are spawned. And also a Trigger at the end of the Block for spawning new Blocks and deleting the last.

Thats the overlap event of the Trigger. Where it also calls the AddBlock and deletes old Blocks after 2 Seconds.

The Graph of my custom Gamemode where it with the loop for the first 3 Blocks at the start of the game.

Thats the Addblock function in the custom Gamemode BP.
So, where and how do i implement the random X and Z location spawning?
Any help is appreciated.


here is a solution that should work: