So i made a function to detect if a part is placeable, if the part is not touching any parts inside the CantTouch table, then it is placeable, otherwise it isnt, but if CanQuery is off then this will not work. Any ideas how to do this, with raycasts perhaps?
function isPlaceable(Prop)
local TouchingParts = workspace:GetPartsInPart(Prop)
local CantTouch = {}
for i, v in pairs(game.Workspace.Nodes:GetChildren()) do
table.insert(CantTouch, v.Zone)
end
for i, v in pairs(game.Workspace.NodeBarricades:GetChildren()) do
table.insert(CantTouch, v)
end
for i, Part in pairs(TouchingParts) do
if table.find(CantTouch, Part) then
return false
end
end
return true
end