You'd probably be interested in Collision Groups, they allow you to set what collides with what. You could use that to loop through the character parts and make it so that it cant interact with walls and whatever else you want.
local ps = game:GetService("PhysicsService")
ps:CreateCollisionGroup("Character")
ps:CreateCollisionGroup("Parts")
for i, v in ipairs(plr.Character) do
if v:IsA("BasePart") or v:IsA("MeshPart") then
ps:SetPartCollisionGroup(v, "Character")
end
end
for i, v in ipairs(game.Workspace) do
if v:IsA("Part") then
ps:SetPartCollisionGroup(v, "Parts")
end
end
ps:CollisionGroupSetCollidable("Character", "Parts", false/true)
1 comment
yo are you gonna accept my answer