Hi, I’m using a blueprint as a spawner, it spawns many objects of another blueprint class in time intervals (through a Delay), in randomly offseted locations to give a procedural generation effect.
The spawned blueprint’s static mesh has collision to Block All and a collision mesh. The “Spawn Actor from Class” function in the spawner blueprint (in the image below) has “Spawn Even if Colliding” disabled, but I’m getting overlaped spawns frequently.
I first thought that the problem could be a “Set Location” funciton in the spawned blueprint processed every Tick, but for test purposes I’ve disabled it, and the now static spawns still get overlaped.
Do you know what can I do to prevent spawned blueprints’ overlaping?
Use a “Begin Overlapping” event on the individual asteriroid blueprint so it destroys itself (or the other actor) if it’s of the asteroid bluperint. I think I used something like that to solve it.
I agree with you that it’s not a perfect solution, although you can use flow control (Branch, etc.) and some kind of invisible touching volume or other stuff to each in each area or at certain intervals if there’s enogh asteroids, if not you can make the spawn again there, maybe a limited version of the spawn.
Still same problem here.
Could make a checker function but I figured this should be built in - or at least was intended to be built in.
As for the checking function:
My solution is to spawn the actor far away from the game area, then generate a random place for it, then check the bounds extents and origin against the hypothetical spot with a overlap sphere check, then if there is a colliision, do it again.
Put it on a counter in there so if it checks 10 times with no success, then destroy the object and move on.