Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I make a script than can enable and disable player - player collision?

It is not working for me

p = game.Players.LocalPlayer.Character:GetChildren()
game.Players.LocalPlayer.Character:GetChildren() do
	p.CanCollide = true
end

3 comments

0

That'd imply using CollisionGroups, and since the following link isn't practically deserving to be an answer (I didn't make it) i'm posting it here. https://pastebin.com/fFdFJr1D

0

I did something similar to this recently and found this article useful: http://robloxdev.com/articles/Player-Player-Collisions. It covers assigning all players to a " player" collision group and then sets that "player" collision group to not collide with itself using https://wiki.roblox.com/index.php?title=API:Class/PhysicsService/CollisionGroupSetCollidable.

1 answer

✓ Accepted answer

It is only the torso that collides, try this:

player = game.Players.LocalPlayer

while true do —whatever loop you want

player.Character.Torso.CanCollide = false
wait(1)
player.Character.Torso.CanCollide = true
wait(1)

end

Basically change the canCollide property of Torso. You dont need to chabge the other stuff

This discussion is preserved as it was. New answers, comments, and votes are closed.