Is there any way of disabling collisions in a character?

Hello devforum, basically I am making a pair of handcuffs and I want to disable collisions on the arrested plaeyr so this doesnt happen:
https://gyazo.com/d16a6113ab827368531cb602b61b3c53

Thank you!

You should use a for i,v in pair’s loop, example:

for i,v in pairs(plr.Character:GetDescendants()) do
 if v:IsA("MeshPart") or v:IsA("Part") or v:IsA("UnionOperation") then
  v.CanCollide = not v.CanCollide --// Makes CanCollide The Opposite of what it is at that moment.
 end
end)

and yeah pretty simple.

2 Likes

humanoid characters reset their CanCollide property to true every frame & toggling the property on every descendants would make previously non-collidable parts (i.e accessories, arms and legs) collidable

a better approach would be to set up a CollisionGroup that doesn’t collide with other humanoids and set the arrested player into that CollisionGroup

2 Likes

Oh really, I had no idea. I’ve never really made anything like this so I just assumed it would work. he should probably just use a weld instead since it looks like he’s using a loop to move the hand cuffed player, and that should probably work better regardless.

1 Like

iirc welds are very finicky especially when another player-controlled character is involved, it’s generally not a very good practice because of how NetworkOwnership works which would either makes it a convoluted mess is set or an exploit-fest because one party would have access to the other party’s character and thus being able to manipulate them in the same freedom as they could their own character, I’ve heard using RunService.Stepped works well enough as a subtitude however (do note that I don’t have a lot of actual experience in this field and these are just educated guesses)

1 Like

Tried the collision group thing and you’re correct.

To make the player not be collidable then use this.

for i,v in pairs(v:GetDescendants()) do
	if v:IsA("MeshPart") or v:IsA("Part") or v:IsA("UnionOperation") then
		v.CollisionGroupId = 15000 
	end
end

To make the player collidable again use this:

for i,v in pairs(v:GetDescendants()) do
	if v:IsA("MeshPart") or v:IsA("Part") or v:IsA("UnionOperation") then
		v.CollisionGroupId = 0 
	end
end

And yeah I guess that’s that.

The 15000 is a random number you could switch it with anything if you really wanted.

3 Likes