Why does the model not cancollide = false with player?

Hi, so I have a placement script for buildings in my open world game, and I want it so that the building does not collide with the player while they are choosing a place to put it, so I set it’s cancollide property to FALSE before they place it but it still collides with the player! I was wondering why this is happening and if anyone has a way to make it not collide with the player I would be very grateful indeed. Thanks!

You need to make every individual part cancollide false since the model does not have such property.
you should do something like this

for _,v in pairs(game.Workspace.Model:GetChildren()) do
if v:IsA("Part") then
v.CanCollide = false
end
end

CanCollide isn’t a property of a Model. You need to set the CanCollide of each BasePart in the Model throug ha for loop using Instance | Roblox Creator Documentation.

I did but it still collides with the player and nudges them off a bit. Here is my code:

function makeCurrModelCanCollideFalse(currModel) for i, v in ipairs(currModel:GetChildren()) do if v:IsA("Part") then v.CanCollide = false end end end

Use BasePart instead of Part. And use GetDecendants over GetChildren. Otherwise you will miss a lot of possible Instances that should have their collisions turned off.

2 Likes

thank you for correcting, him and myself. Greatly appreciated.

Thank you so much! Genius man!

And thanks all for the help

1 Like