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
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
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.
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.
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.
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.
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!