How to spawn 2d ledges at random points in my endless runner game?

I am working on a 2d endless runner game but stuck at point I want my ledge sprites to spawn at random points for my character to jump on them(ledges are on different z coordinate).

125255-untitled.png

try the “random point in bounding box” node - you can then set the bounds of the area you want your ledges to spawn

then use debug draw box etc to visualize this so you can tune/tweak it to be exactly what you want