If you want to spawn without overlapping, you'll need to track the location of each spawned actor (probably in a table) and not spawn further actors that will overlap with that area. It's a lot more difficult than you might think. An easier route some people take is to spawn the actors invisible, and if they overlap with another, destroy them and spawn another one, and if they don't overlap with another, show them. With actors as big as in your example that probably wouldn't work very well, though.
tatiangMember, Sous Chef, PRO, Senior Sous-ChefPosts: 11,949
You might consider looping through a table of preset values (x and y) that ensure that you won't have overlaps. It's not truly random but if you use enough variance it can appear to be so.
Comments
If you want to spawn without overlapping, you'll need to track the location of each spawned actor (probably in a table) and not spawn further actors that will overlap with that area. It's a lot more difficult than you might think. An easier route some people take is to spawn the actors invisible, and if they overlap with another, destroy them and spawn another one, and if they don't overlap with another, show them. With actors as big as in your example that probably wouldn't work very well, though.
You might consider looping through a table of preset values (x and y) that ensure that you won't have overlaps. It's not truly random but if you use enough variance it can appear to be so.