Carry script experiences issues when it comes to collision

Unsure if i had done it correctly, but as you can see:

image
Defined “model” is equal to the targets character.
I grab the descendants & check for basepart, then setPartCollisionGroup

I have NO PRIOR information where it sets part collison other than these 2 functions so that might be an issue but I have no clue.

Can you put a print in the loop and print v.


This is the result

It could possibly be something to do with the rope?

I think I may have discovered what has been happening. I’ve tested and seen that accessories weren’t detected therefore they are collidable.

Went back to look because I still had it running and turns out I cut off the image too early because I thought it was something else.

Oh well it made the part uncollidable for only my character so i’m not sure what has happened for you.

To make it easier for you, here is the entire code as a lot of it is cut out in the pictures I send, you might see something with the entire code.

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Lighting = game:GetService("Lighting")
local groupinfo = require(ReplicatedStorage.GameInfoStorage.GroupInformation)
local PhysService = game:GetService("PhysicsService")
local PlayerGroup = PhysService:CreateCollisionGroup("p")
PhysService:CollisionGroupSetCollidable("p","p",false)

local PlayerGroup = PhysService:CreateCollisionGroup("a")
PhysService:CollisionGroupSetCollidable("a","a",true)



ReplicatedStorage.RemoteEvents.Ragdoll.OnServerEvent:Connect(function(plr,state)
	plr.Character:WaitForChild("Ragdoll").Activate.Value = state
end)


function NoCollide(model,ownerchar)
	print("GotExecuted (nocollide)")
	for k,v in pairs(model:GetDescendants()) do
		if v:IsA"BasePart" then
			print(v)
			PhysService:SetPartCollisionGroup(v,"p")
			if not model == ownerchar.Character then
				v:SetNetworkOwnership(ownerchar)
			end
		end
	end
end


function Collide(model)
	print("GotExecuted (collide)")
	for k,v in pairs(model:GetDescendants()) do
		if v:IsA"BasePart" then
			PhysService:SetPartCollisionGroup(v,"a")
			v:SetNetworkOwnership(nil)
		end
	end
end



ReplicatedStorage.RemoteEvents.Carry.OnServerEvent:Connect(function(plr,state,targetCharacter)
	if targetCharacter ~= nil and game.Players:FindFirstChild(targetCharacter.Name) and plr.Character ~= targetCharacter then
		if game.Players:FindFirstChild(targetCharacter.Name):WaitForChild("PlayerInfo").Roped.Value == true and targetCharacter:WaitForChild("Ragdoll").Activate.Value == true then -- already roped, remove.
			
			game.Players:FindFirstChild(targetCharacter.Name):WaitForChild("PlayerInfo").Roped.Value = false
			if targetCharacter.HumanoidRootPart:FindFirstChild("Restraints") then
				targetCharacter.HumanoidRootPart:FindFirstChild("Restraints"):Destroy()
			end
			
			Collide(targetCharacter)
			Collide(plr.Character)
		else
			
			
			if not targetCharacter.HumanoidRootPart:FindFirstChild("Restraints") and targetCharacter:WaitForChild("Ragdoll").Activate.Value == true then
				game.Players:FindFirstChild(targetCharacter.Name):WaitForChild("PlayerInfo").Roped.Value = true
				local Restraints = Instance.new("Folder",targetCharacter.HumanoidRootPart)
				Restraints.Name = "Restraints"
				
				
				local BallSocket = Instance.new("RopeConstraint")
				BallSocket.Parent = Restraints
				BallSocket.Attachment1 = plr.Character.LeftHand.LeftGripAttachment
				BallSocket.Attachment0 = targetCharacter.HumanoidRootPart.RootRigAttachment
				BallSocket.Length = 0.03
				BallSocket.Visible = false
				
				plr.Character.Humanoid:ChangeState(Enum.HumanoidStateType.Flying)
				targetCharacter.Humanoid:ChangeState(Enum.HumanoidStateType.FallingDown)
				
				NoCollide(targetCharacter,plr)
				NoCollide(plr.Character,plr)
				
				
			end
			
			
		end
	end
end)


game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(character)
		character.Ragdoll.Activate.Changed:Connect(function()
			print("oop")
			if plr.Character:WaitForChild("Ragdoll").Activate ~= true then
				if plr.Character.HumanoidRootPart:FindFirstChild("Restraints") then
					plr.Character.HumanoidRootPart:FindFirstChild("Restraints"):Destroy()
					plr:WaitForChild("PlayerInfo").Roped.Value = false
				end
			end
		end)

		character:WaitForChild("Humanoid").Died:Connect(function()
			if plr.Character:FindFirstChild("Head") then
				if plr.Character.HumanoidRootPart:FindFirstChild("Restraints") then
					plr.Character.HumanoidRootPart:FindFirstChild("Restraints"):Destroy()
					plr:WaitForChild("PlayerInfo").Roped.Value = false
				end
			end
		end)

	end)
end)

Don’t make the groups variables. Just use do PhysService:CreateCollisionGroup(“p”) alone.

I changed it and it didn’t help with the issue and still works the same :sob:

Oh wait you aren’t setting the ownerchar’s collision group? Both chars need to be in the collision group for it to work.

It runs for both the player & the ragdolled character.
image

Oh I get it. If the ownership for both chars are equal to one player then it will cause the physicsservice to not work. (I tested this myself)

Are we talking about Networkship at the moment? I don’t quite understand :confused:
How would I resolve this issue?

Set the network owner of the carried person to the server or their player.

After making it to the server, it continues to do the bug.
Could it possibly be something to do with the actual rope? Possibly a roblox bug maybe?

It’s not a bug however I don’t know why it isn’t working for you in this scenario.

I think i’ll attempt to do another system, but I must thank you for your help.

Terrain is in the ‘Default’ collision group.

I’ve never heard of collision groups, how do I go about fixing this issue then? What should I change specifically?