spawn platforms randomly

Hi there,
it’s me again with some trouble we have on programming our endless runner game. Again it’s the first time we dig into the UE4 and the blueprints.
Our idea is to spawn 10 platforms at the beginning. After activating their triggers, we delete the last and add a new platform. This concept worked fine till we tried to spawn 2 different platforms randomly.

This is how we spawn our platforms. I debugged the value of LastPlatformPosition, it’s correct calculated.

When I ran the game, the platforms aren’t placed how they should be…

They overlap for some reason we coulnd’t figure out yet.
Do you have any idea how to fix this problem?


I believe you need to add the length of your last platform, not the length of the new one. If you make a variable for Last Platform Length, and one for Current Platform Length, that should sort things out.

Oh, that’s right. Thanks a lot! :slight_smile: