Get overlapping actors issue

This may help you, it’s about spawning dungeons but essentially your doing the same thing more or less, instead of having unique sized rooms yours are just two different sized squares…

you may have to watch a few parts of this series to realize what im trying to say here but
it would be easier to spawn these chunks if you place the first one into the level, then spawn one at each point around it… essentially what the guy in the video does but you have an exit point on each side… when you’ve generated sufficient rooms on your interior, this is when you “swap lists” of rooms for the remaining 20 rooms or whatever

If your going for purely a square shape, similar process but more math’s related
Place the center room, Get it’s size and for each XY spawn a room

Ex. X,Y
Placed room at 0,0
//Top
Spawn room at 0+300,0-300
Spawn room at 0+300,0
Spawn room at 0+300,0+300
//Middle
Spawn room at 0,0-300
Spawn room at 0,0+300
//Bottom
Spawn room at 0-300,0-300
Spawn room at 0-300,0
Spawn room at 0-300,0+300

This is what you do to have a 3x3 square when it gets to doing larger shapes you have to calculate the length of your current set of squares instead of the length of a single square

Like this:

so when it gets bigger than the 3x3 instead of doing 300 you’d calculate that value as well or store start using arrays like this


to get any size square

it gets far more complicated from here when we decide to make the next squares larger or smaller
But essentially you want to not spawn the smaller squares where they would overlap or spawn them and then decide to delete them, Hence why i recommend watching the video above and going that method

Instead of doing exactly as he does so it ends up being random
Generate the set of rooms/tiles around the first set of exits and remove those exit points then get the next set of exit points you’ve just made and repeat

If the combination of all this advice doesn’t help you or you don’t understand it, i’d recommend trying to make something else before you try this, there’s all kinds of things that could cause you problems if you don’t understand the how and why

Pure nodes don’t always return the result you expect
Math is hard
Nested loops get exponentially more complicated to debug
^ 100s of other reasons that these get more complicated atop that

Also check out this video on Binary Space Partitioning Algorithms
Almost exactly what you may be trying to do

TLDR getting overlapping actors the way you are is getting them at the time that it’s spawned and not after something has spawned in the same space