local function checkObjectColiding(size, position, previewModel)
local params = OverlapParams.new()
params.RespectCanCollide = true
params.FilterDescendantsInstances = {previewModel:GetDescendants()}
local box = workspace:GetPartBoundsInBox(CFrame.new(position), size, params)
print(box)
if #box >= 1 then
return false
else
return true
end
end
however for some reason the box still returns object inside of itself:
I’m making a build system, and it should filter the preview object I am placing. so what did I do wrong?
It’s enough to put the preview model alone (without :GetDescendants()) in FilterDescendantsInstances for all descendants to be evaluated. Try setting FilterType to Exclude explicitly.
its really weird because sometimes it works and sometimes it doesnt (just like before):
updated code:
local function checkObjectColiding(size, position, previewModel)
local params = OverlapParams.new()
params.RespectCanCollide = true
params.FilterType = Enum.RaycastFilterType.Exclude
params.FilterDescendantsInstances = {previewModel}
local box = workspace:GetPartBoundsInBox(CFrame.new(position), size, params)
print(box)
if #box >= 1 then
return false
else
return true
end
end
Quite odd. I couldn’t reproduce the issue, everything works as it should with that code and different part properties. I don’t have a theory on what could be wrong. The only detected model member is that modelRoot, right?
We know that currently with ray- and shapecasting, if the rays start inside the part, that part won’t be considered, but that shouldn’t have anything to do with getting parts.
Would you consider sending a repo (you can send me a PM if you wish)?