How do you disable the collisions on a character

I’ve been having issues with noclip problems inside my game, basically people can grab an npc or another player then spin around to get through any wall (literally any wall) and i figured out that disabling the collision would fix the problem, but here’s the thing, none of the possible methods i’ve tried work at all, they still clip through the wall and cause physics bugs.

Methods i’ve tried:
SetNetworkOwner:()
Changing the collision groups
Setting all body part collisions to false with a loop (plus its a horrible idea)
and all of the above combined

if anyone has a possible fix to this please tell me

Code i've been using (really messy)
local Collisions = game:GetService("PhysicsService")
local CollisionGroup = "Humanoid "..CHARACTER.Name.." Collision group"
Collisions:CreateCollisionGroup(CollisionGroup)
for _,v in pairs(CHARACTER:GetChildren()) do
	if v:IsA("BasePart") then
		print(v)
		Collisions:SetPartCollisionGroup(v, CollisionGroup)
	end
end

CHARACTER.Character.Values.BeingCarried.Changed:Connect(function()
	if CHARACTER.Character.Values.BeingCarried.Value == true then
		CarryAnim:Play()
		Collisions:CollisionGroupSetCollidable(CollisionGroup, CollisionGroup, false)
		wait(0.7)
		for _,v in pairs(CHARACTER:GetChildren()) do
			if v:IsA("BasePart") then
				print(CHARACTER.Character.Values.Carrier.Value.Name)
				if CHARACTER.Character.Values.Carrier.Value:WaitForChild("Character").Values.IsAPlayer.Value == true then
					v:SetNetworkOwner(game.Players:GetPlayerFromCharacter(CHARACTER.Character.Values.Carrier.Value))
					else
				end
			end
		end

	elseif CHARACTER.Character.Values.BeingCarried.Value == false then
		CarryAnim:Stop()
		Collisions:CollisionGroupSetCollidable(CollisionGroup, CollisionGroup, true)
		for _,v in pairs(CHARACTER:GetChildren()) do
			if v:IsA("BasePart") then
				v:SetNetworkOwner()
			end
		end		
	end
end)

also, i’ve checked every devforum post thats about character collisions and none of them have helped

1 Like
local Players = game:GetService("Players")
local PhysicService = game:GetService("PhysicsService")

local function ChangeGroup(Part)
	if Part:IsA("BasePart") then
		PhysicService:SetPartCollisionGroup(Part, "Players")
	end
end

char.ChildAdded:Connect(ChangeGroup)
for _, Object in pairs(char:GetChildren()) do
	ChangeGroup(Object)
end

This should be added in a characterAdded event.

its not meant to be for only players, its also meant to be a fix for npcs

For npc can’t you manually do that? I think it would still apply just loop through all npc and run that function. I’m sorry if this doesn’t help, I’m still learning how collisions work.

its fine, im just a bit stressed that i cant find a solution on the devforum

Hopefully this will help you out!

thing is, thats exactly what im doing

Oh, I have tried to use it before but I couldn’t get it to work, Mainly because it was taking to long I’m sure someone will be able to help! I will keep looking to see if I can a way to help you.

thanks man, i really appreciate it, its just that this bug is really annoying (and really game breaking aswell)

Btw I just wanted to check when you used the Collider Setting did you add the parts to they players?

i did, well only for npcs since i dont have anyone to playtest it with (i’ll later apply it to players)

I tried messing around with the collisions groups and managed to make it work: https://gyazo.com/793ec2fe885b31e33353f8ed861b8502

does it work while they’re platformstanding? (and if so can you possibly share the code?)

What is platformstanding? Sorry I don’t understand what you mean.
For the problem there were no scripts involved, I had created a collision group called NPC and added the Npc part to it, I then unticked the first box. Hopefully this helps.

platformstanding is basically just a bool that disables all character movement and basically acts as a sit that you cant get out of

Oh right, It should work unless the platformstanding changes any collision Groups. It should work fine.

apparently i need to disable the default collision on the person thats being carried (i dont know how to do that)

I think you would find a way to untick default on the server, If you look at the dev hub link I sent earlier they show a line of code that could possibly do that.

i cant find it for some reason

after a while of messing around with physics service, and learning how to get the default collision through its id, i finally managed to get it working, even though you may have not given me an exact solution, you were alot of help, thanks a bunch!