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