Make it so a player / NPC no collide?

Issue: I have a carry system in my game where you can carry players and NPCs. and it throws them over your shoulder. Only problem is that when you are carrying a player the carried player can still collide with the environment. Meaning you cannot fit through certain doorways while carrying a player or climb onto walls which is another feature in my game.

How can I make it so whenever I carry a player they cannot collide with the world around them so I can actually get through stuff? Player collisions are already disabled.

1 Like

You could make a script that detects when a player is carried and set the carried player’s lowerTorso CanCollide toggle to false.

1 Like

I use R6 in my game and you cannot set the parts nocollide to false they just auto set back immediately.

Ok let me see if i can find a solution online, you keep doing your research :slight_smile:

1 Like

my game already uses collision groups for player collisions and stuff like that.
but idk how to make it ignore everything in the workspace.

Make The NPC A Different Collision Group When U Carry, when u throw its changes collisions again

1 Like

The Default Collision group is everything in the workspace. If you make a collision group for the carried player/NPCs and set that group to not collide with the Default one does that work?

1 Like

After some research I think i have found a possible solution; since roblox has local scripts to change things from a clients pov, we could make a value in each of the players to check if they are being carried: Pleas Note that i did not use roblox studio to test this so errors might be discorvered:

local player = game.Players.LocalPlayer
local isCarried = player.Character:WaitForChild("isCarried") --Insert a bool value into every player when they join from a server script 

isCarried:GetPropertyChangedSignal("Value"):Connect(function() --Make a script elsewhere to change this property when a player is carried
   if isCarried.Value == true then
      for i, v in pairs(workspace:GetDescendants()) do
            if v.Name ~= "Baseplate" then --So they wouldn't fall into the void
            v.CanCollide = false
           end
      end
   elseif isCarried.Value == false then
       for i, v in pairs(workspace:GetDescendants()) do
           v.CanCollide = true
      end
end)

You can use if statements inside the for i, v pairs to filter out stuff you might need to be able to collide with like the baseplate filter i did

Hope this helps :slight_smile:

1 Like

Are you saying that the player collision group is already different from the collision group of everything in workspace?

1 Like

let me try this out. Will get back to you.

@Nifemiplayz that would only work for players and not NPCs.

Since players and NPCs both have models you can insert the boolvalue into NPC and change it aswell

Player collisions normally react to the Default collisions, so you’d have to change them.

2 Likes

Oh ok, thankyou for informing me that makes sense.

thats a local script though. . There is no client to an NPC.

You can use a script instead and change player to the NPC

1 Like

no because that would set the entire workspace on the server to not be collided with.
Every player would fall through the map just because I carried one mob.

Oh yea your right, instead of setting the environment probably set the characters collision group?