Player carrying bug makes it a liability

Hello. In my game, I have a carrying feature. For the most part, it works, but overall, it’s just a liability to the player’s mobility.

The player carrying the other player:

  • Cannot move while jumping

https://gyazo.com/fff4a7a898556a7e946b5733da7001a2

  • Whenever the player is near a part they are slowed down

https://gyazo.com/760a330e0cda80c09cd6986710a7cd6c

  • Whenever the other player dies, the one carrying them does as well

I’m not sure what I can do to really fix these problems. Any help?

I use a motor and a body gyro for this to work.

local carryMotor = ServerStorage.Models.CarryMotor:Clone()
carryMotor.Part0 = target.HumanoidRootPart
carryMotor.Part1 = root
carryMotor.Parent = root
				
local bodyGyro = ServerStorage.Models.GrabBg:Clone()
bodyGyro.Parent = target.HumanoidRootPart

image

Thanks for reading.

2 Likes

Have you SetNetworkOwnership to the player carrying the other player?

2 Likes

How would set ownership of the other player exactly?

1 Like

Read this article (don’t forget that you would set network ownership of the character, not the actual player entity).

3 Likes

SetNetworkOwnerShip
By doing this
when giving weld:

for i,v in ipairs(URmodel) do
if v:IsA("Basepart") then
v:SetNetworkOwner(Player)
end
end

Remember, the dummy parts must be anchored to make it work!

1 Like


Also, even when unanchored, it didn’t change anything.

Parts must be anchored, or it’s not going to work.

I anchored the parts and it gave me that error.

I tried to set the network ownership before the parts become anchored, and that seems to literally just anchor. Am I missing something?

for i, v in ipairs(target:GetChildren()) do
	if v:IsA("BasePart") then
		v:SetNetworkOwner(player)
	end
end
				
for i, v in ipairs(target:GetChildren()) do
	if v:IsA("BasePart") then
		v.Anchored = true
	end
end

You should not set the network ownership of anchored parts, that causes an error and anchored parts don’t necessarily have network ownership as they have no physics beyond collision detection.

What do you think I should do then?

The first code snippet you were given should be enough so long as you add an if statement to make sure the part isn’t anchored.

for _,obj in pairs(model:GetChildren) do
    if obj:IsA("BasePart") and not obj.Anchored then
	obj:SetNetworkOwner(Player)
    end
end

Alternatively, you could just wrap it in a pcall and call it a day. Possibly ugly and people on here get shouty at you for it but it works.

for _,obj in pairs(model:GetChildren) do
    if obj:IsA("BasePart") then
	pcall(function() obj:SetNetworkOwner(Player) end))
    end
end
1 Like

It doesn’t seem to do anything.

Are you running it in a Script, or a LocalScript?

A script. I’m doing this before putting in the motor6D, is that the problem?

That shouldn’t be an issue. At this point I suspect the other player’s client is re-asserting network ownership over their character, so trying to set it yourself would be futile. Would it be feasible to create a fake character rig for this purpose instead?

You mean the dummy I’ve been using?

My bad, I thought you were using another player’s character directly. If you’re already using a fake rig for this, I’m all out of ideas. Sorry.

1 Like

The game requires a humanoid at all times in a character, but most of the states are disabled.

1 Like

You can’t set network ownership on anchored parts because there aren’t any physics to be calculated - you set network ownership on unanchored parts.