best way for vertical platform spawning

Hi!
I’m making a vertical platformer where platforms generate as you go, to then “fall” to the bottom of the screen.
But i’m having a hard time finding a good way to make them spawn.
right now i’m making one spawn every second, at the highest point the player reached + an offset.
But this makes them stack sometimes so yeah not ideal.

I was thinking of making them spawn a certain distance from the previous one, but that would bring problems:
i also have static platforms, so if a player stands on one of those and waits for a while, the moving platforms would stack infinitely so that would be a problem.
ideally i would need a limit to that second solution here, but i have no idea how to code it so any help would be appreciated.
Thanks in advance!

Just check how high the proposed spawn location is, and do NOT spawn the platform if the proposed spawn location is more than a certain distance above the player in the direction of “up.” which is usually the +Y direction.