How do I spawn an object in a random but "safe" location?

So, I made a blueprint to randomly spawn physics-simulated rocks within a volume.
Naturally, if any 2+ rocks spawn clipping each other, they’ll fly in opposite directions from the phantom physics impulse. So is there a way I can say “after the random location is generated, check if rock is colliding with anything, if so, make a different random location”?

Here’s a few more things about the blueprint in case they matter:
-The mesh components and their locations/rotators are generated at EventBeginPlay.
-I use floats to generate the locations, as seen in the screenshot below.
-There is an editor-exposed variable that controls the number of rocks to spawn. I’d like to keep this feature, but it would obviously need a limit since only so many rocks can be spawned in a set volume without clipping. So bonus question!: how would I go about calculating a percent-based “density” variable instead of “number of rocks”, where 100% would be the maximum amount of rocks that can cleanly fit in the volume?

I’m mainly a 3D artist and not a programmer, so if anything else about my blueprint looks stupid or inefficient please let me know, I’m here to learn.

Thanks!

You should check scattering feature. It could be useful to you.

As for your particular problem: just check the collision after you spawn a rock. If it occurs, destroy spawned actor and try again. But this is very bad and dangerous behavior, because you can stuck in infinite loop.

Do you still need any help?

I’m going to check out the scattering feature now, thanks for your help! If that doesn’t work out, is there a BP node to check collision?

Sure get overlapping actors