So i have this random tree generation code
for i = 1,10 do
local tree = game.ServerStorage.tree
local bottomright = Vector3.new(180,0,-180)
local topleft = Vector3.new(-180,0,180)
local random = Random.new()
local tree = tree:Clone()
tree.Parent = workspace
tree:MoveTo(Vector3.new(random:NextNumber(topleft.X,bottomright.X),2.5,random:NextNumber(topleft.Z,bottomright.Z)))
end
It work's but the thing is the trees clip into each other i've attempted to fix this by using moveto which automatically moves away if its clipping into a part but it only moves away upward so it just makes the script more buggy ;'/ Anyway is there any way i can stop the trees from clipping / positioning into each other?

1 comment
Wont work because what if there is another tree in my moving trees location when i move further away