Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

My placement system collision detector not working?

Asked by 5 years ago

So with my placement system, I have a collision detector, which does not seem to be working. Can someone help me? What it does is it just stays green the whole time, except on the spot its supposed to stay green.

local function DetectCollision(mdl)
    if mdl and isPlacing then
        isColliding = false;

        local collision = mdl.PrimaryPart.Touched:Connect(function() end);
        local collisionPoints = mdl.PrimaryPart:GetTouchingParts();

        for i = 1, #collisionPoints do
            if not collisionPoints[i]:IsDescendantOf(mdl) and not collisionPoints[i]:IsDescendantOf(Kit.Tycoons.Plot1.BaseFloor) and not collisionPoints[i]:IsDescendantOf(player.Character) then
                isColliding = true;

            end
        end
    end
end
0
if the can-collide property of a part is false, GetTouchingParts will return an empty table theking48989987 2147 — 5y
0
No it doesn't. I used print and it worked. CaptainD_veloper 290 — 5y

Answer this question