Answered by
4 years ago Edited 4 years ago
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.
01 | local ps = game:GetService( "PhysicsService" ) |
02 | ps:CreateCollisionGroup( "Character" ) |
03 | ps:CreateCollisionGroup( "Parts" ) |
04 | for i, v in ipairs (plr.Character) do |
05 | if v:IsA( "BasePart" ) or v:IsA( "MeshPart" ) then |
06 | ps:SetPartCollisionGroup(v, "Character" ) |
09 | for i, v in ipairs (game.Workspace) do |
11 | ps:SetPartCollisionGroup(v, "Parts" ) |
14 | ps:CollisionGroupSetCollidable( "Character" , "Parts" , false / true ) |