Hi everyone!
I want to make an system that spawn platforms. The player has to jump on them and get to the top.
The actual code works like this:

I want to make somthing like this:

I can't use just random position, because player has maximum jump distance, and I have no idea how to make this algorithm.
Thanks.