Download

How to add spacing between actors spawned within a volume

Hey all,

So I’ve got a blueprint set up to spawn an actor within a volume and it’s working great but the problem that I’m having is that some of the actors are spawning too close to each other. I’m wondering how I would add spacing or padding to this so that they don’t spawn too close to each other?

Any help would be appreciated!

1:Make array of actors(variable)
2:Clear the array before for each loop
3:After spawning actor make for each loop of your array>branch(spawned actor location - loop actor location> vector length <= distance between actors)
4:If true dont do anything, if false destroy spawned actor and plug execution back to spawn actor
Remeber too dont make to many actors/ too big distance between them for too small volume or else you will get infinite loop.
Spawning and destrying actors can be very heavy for cpu so instead of array of actos you can make array of vectors, make single vector variable, set it, then check it for each loop of vectors and true(branch) plug into spawn actor node.

Thanks Dark. I’ll try that :slight_smile: