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

CanCollide wont disable even after I tell it to?

Asked by 6 years ago

I wanted to make it so players could walk through each other because since my game is on a 2d world I didn't want players getting stuck so I figured id make them un-collidable.

I tried this script but It didnt work XD

local player = game.Players.LocalPlayer

game.Players.PlayerAdded:connect(function()
    if player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
        player.Character.LeftFoot.CanCollide = false
        player.Character.LeftHand.CanCollide = false
        player.Character.LeftLowerArm.CanCollide = false
        player.Character.LeftLowerLeg.CanCollide = false
        player.Character.LeftUpperArm.CanCollide = false
        player.Character.LeftUpperLeg.CanCollide = false
        player.Character.LowerTorso.CanCollide = false
        player.Character.RightFoot.CanCollide = false
        player.Character.RightHand.CanCollide = false
        player.Character.RightLowerArm.CanCollide = false
        player.Character.RightLowerLeg.CanCollide = false
        player.Character.RightUpperArm.CanCollide = false
        player.Character.RightUpperLeg.CanCollide = false
        player.Character.UpperTorso.CanCollide = false
        player.Character.Head.CanCollide = false
        player.Character.HumanoidRootPart.CanCollide = false
    end
end)

Umm this is probably the worst way to try and solve this problem but I couldnt think of any other way to script it. Maybe you can?

0
Oh... See I looked on the wiki but I couldnt find that one. Maybe I overlooked it, either way thank youuuuu! GottaHaveAFunTime 218 — 6y
0
You cannot set it to false else the player would fall through the game every time XD User#5423 17 — 6y
0
I know I got it working its all good XD GottaHaveAFunTime 218 — 6y
View all comments (2 more)
0
Please add [SOLVED] in your question's name so people like me don't come in seeing if they can answer. kthx Thundermaker300 554 — 6y
0
Thunder I didnt want to because i was waiting for someone to answer so me and the guy who answered could both get some points. GottaHaveAFunTime 218 — 6y

1 answer

Log in to vote
1
Answered by 6 years ago

For some reason, Roblox will not allow you to set players that cannot collide. We can fix this by using collision groups.

Hope this helps!

Ad

Answer this question