Make a humanoid non-collidable

I’m desperately trying to make a humanoid character non-collidable as it’s supposed to be a spirit behind the player, though collisions will get in the way, both with the player and the environment. I tried the code below which is inside a local script in the character, though it doesn’t change his collision group (it stays on one, also the group “2” is created in another script), which lets him collide with everything. (the collide = false bit doesn’t work either, but that’s expected with humanoids)

local physicsService = game:GetService(“PhysicsService”)

game:GetService(“RunService”).RenderStepped:Connect(function()

for i,v in pairs(script.Parent:GetChildren()) do

  if v:IsA("Part") then
  	
  	v.CanCollide = false
  	physicsService:SetPartCollisionGroup(v, "2")
  	print(v.CollisionGroupId)
  	
  end

end

end)

1 Like

Try

if v:IsA("Part") or v:IsA("BasePart") then
1 Like

Unfortunately it’s still colliding, the collision group also stays at one…

1 Like