Weld 2 players togheter makes them stuck

Im creating a carrying system where P1 carry P2 but when i do, P1 gets stuck due to the P2’s weight. I usually fix welding issues by setting Cancollide to false and Massless to true but for this case it doesnt work. If you’re asking, yes both players are unanchored and i verified if their Massless is propely set to true.

ModuleScript1

local RagModule = require(game.ReplicatedStorage.Modules.Ragdoll)
local MassModule = require(game.ReplicatedStorage.Modules.Massless)

local K_CarryBod = script.K_CarryBod
local K_Idle = script.K_Idle
local K_Moving = script.K_Moving
local V_CarryBod = script.V_CarryBod
local V_Idle = script.V_Idle
local V_Moving = script.V_Moving

function module.AddDrag(killerchar, victimchar)
	local K_Hrp = killerchar:FindFirstChild("HumanoidRootPart")
	local K_Hum = killerchar:FindFirstChild("Humanoid")
	local K_Track1 = K_Hum:LoadAnimation(K_CarryBod)
	local K_Track2 = K_Hum:LoadAnimation(K_Idle)
	local K_Track3 = K_Hum:LoadAnimation(K_Moving)
	
	local V_Hrp = victimchar:FindFirstChild("HumanoidRootPart")
	local V_Torso = victimchar:FindFirstChild("Torso")
	local V_Hum = victimchar:FindFirstChild("Humanoid")
	local V_Track1 = V_Hum:LoadAnimation(V_CarryBod)
	local V_Track2 = V_Hum:LoadAnimation(V_Idle)
	local V_Track3 = V_Hum:LoadAnimation(V_Moving)
	
	
	local prompt = Instance.new("ProximityPrompt", V_Torso)
	prompt.ActionText = "Carry body"
	prompt.Name = "CarryBody"
	prompt.HoldDuration = 1
	prompt.MaxActivationDistance = 8
	
	prompt.Triggered:Connect(function()
		
		K_Hum.WalkSpeed = 0
		K_Hum.JumpHeight = 0
		K_Hrp.Anchored = true
		K_Hum.AutoRotate = false
		V_Hrp.Anchored = true
		V_Hrp.CFrame = K_Hrp.CFrame * CFrame.new(0, 0.5, -0.5)
		K_Hrp.CFrame = CFrame.lookAt(K_Hrp.Position, Vector3.new(V_Hrp.CFrame.X, K_Hrp.CFrame.Y, V_Hrp.CFrame.Z))--killer rotate to victim
		V_Hrp.CFrame = CFrame.lookAt(V_Hrp.Position, Vector3.new(K_Hrp.CFrame.X, V_Hrp.CFrame.Y, K_Hrp.CFrame.Z))--victim rotate to killer
		
		RagModule.Ragdoll(false, victimchar) --Disable Ragdoll
		V_Hum.AutoRotate = false
		V_Hum.WalkSpeed = 0
		
		K_Track1:Play()
		V_Track1:Play()
		prompt:Destroy()
		
		K_Track1.Stopped:Connect(function()
			
			V_Hrp.Anchored = false
			
			K_Track2:Play()
			V_Track2:Play()
			
			local Weld = Instance.new("WeldConstraint", V_Hrp)
			Weld.Part0 = V_Hrp
			Weld.Part1 = K_Hrp
			
			K_Hum.WalkSpeed = 40
			K_Hum.JumpHeight = 0
			K_Hrp.Anchored = false
			K_Hum.AutoRotate = true
			
			MassModule.Light(victimchar)
		end)
	end)
end

Module script 2

function module.Light(victim)
	for _, p in pairs(victim:GetDescendants()) do
		if p:IsA("BasePart") then
			p.Massless = true
			p.CanCollide = false
			p.CustomPhysicalProperties = PhysicalProperties.new(0.01, 0.5, 0.1, 1, 1)
		end
	end
end

(Theses module scripts are called from a server script)

1 Like

hi!
try to set victim’s network owner as your player, if u havent yet

If i did it correctly, it doesnt work either

function module.Light(killerchar, victimchar)
	for _, p in pairs(victimchar:GetDescendants()) do
		if p:IsA("BasePart") then
			p.Massless = true
			p.CanCollide = false
			p.CustomPhysicalProperties = PhysicalProperties.new(0.01, 0.5, 0.1, 1, 1)
		end
	end
	
	local victimPlayer = game.Players:GetPlayerFromCharacter(victimchar)
	local killerPlayer = game.Players:GetPlayerFromCharacter(killerchar)
	victimPlayer:SetNetworkOwner(killerPlayer)
	
end

usually networkowner sets to some part, like Part:SetNetworkOwner(player) or smt, idk correctly how to work w that with characters, but I’ve seen someone making this (grabbing players)

Also not working, i’ll try to inform myself about how SetNetworkOwner works tho

function module.Light(killerchar, victimchar)
	
	local killerPlayer = game.Players:GetPlayerFromCharacter(killerchar)
	
	for _, p in pairs(victimchar:GetDescendants()) do
		if p:IsA("BasePart") then
			p.Massless = true
			p.CanCollide = false
			p.CustomPhysicalProperties = PhysicalProperties.new(0.01, 0.5, 0.1, 1, 1)
			
			p:SetNetworkOwner(killerPlayer)
			
		end
	end
	
end

There might be issues if the killerPlayer is massless, so make sure they aren’t.

1 Like

It do work now, thank you !

zzzz

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.