i am working on a game with a tree growing system (kinda like the one from lumber tycoon2) and i want to make it so the trees cannot grow next to each other. it kinda works but sometimes it doesnt
picture:
here is the script im using: also im using a rotated region3 module because its easier. you just put the cframe and size, but i have tried using the normal one and the issue was still there. i have tried visualizing the region3 as a part to see if its in place, and yes it is. could it be a roblox glitch or am i doing something wrong?
local region = RR3.new(regionPart.CFrame,Vector3.new(moduledrzewa.dystansodinnychdrzew*2,moduledrzewa.dystansodinnychdrzew*2,moduledrzewa.dystansodinnychdrzew*2))
regionPart:Destroy()
local parts = region:FindPartsInRegion3()
local canGrow = true
for i,v in pairs(parts) do
if v.Name == "Drewno" then
canGrow = false
end
end
if canGrow == true then
-- this is where the sappling spawns.