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

How do I make the player's body parts collidable?

Asked by
MrHerkes 166
6 years ago

This is making my head itch. I try to make the whole body collidable, but there's no effect. I also tried the loop to do that. Still no effect. Is there any way to make some parts collidable?

1 answer

Log in to vote
0
Answered by 6 years ago

That's odd. It should be working as long as you set the CanCollide value to true on all the player's limbs. Try using this script, it will loop through the character's children and make them collidable once the player joins or respawns.

game.Players.PlayerAdded:connect(function(plyr) --Player joined the game
    plyr.CharacterAdded:connect(function(char) --The character loaded/respawned
        for i,v in pairs(char:GetChildren()) do --Gets all the children in the character
            if v:IsA('BasePart') then --If the Instance is a part then
                v.CanCollide = true --Make it collidable
            end
        end
    end)
end)
Ad

Answer this question