Server-sided player ragdolls going much further than NPC ragdolls

Hi all, making a fighting game that uses ragdolls. I had made them server-sided to reduce latency between clients but I’ve run into an annoying issue.


As you can see here, whenever I ragdoll a player, they get knocked back a long distance, but when I attack the dummy, it gets knocked back the expected distance.

I’m using :ApplyImpulse() to apply the force to the ragdoll, and before applying it I multiply the velocity by the RootPart’s AssemblyMass. Both characters have the same AssemblyMass on the RootPart.

I also have a PreSimulation event that sets the network owner of the RootPart to nil, could this somehow be messing with the physics of the player?

Did some more testing, all the Velocity values are the same for both the player and the NPC.

All the limb properties in both the player and the NPC are exactly the same.

This is the code that sets the NetworkOwnership for the HumanoidRootPart inside of a Module named “HumanoidManager” to set all the values and create the ragdoll joints. This code is in a function that runs whenever a new character is added.

local RagdollOwnershipConnect = RunService.PreSimulation:Connect(function()
	local Ragdolled = Humanoid:GetAttribute("Ragdoll")
	if Ragdolled == true or Humanoid:GetState() == Enum.HumanoidStateType.GettingUp or Humanoid:GetState() == Enum.HumanoidStateType.Physics then
		RootPart:SetNetworkOwner(nil)
	elseif Ragdolled == false and (Humanoid:GetState() ~= Enum.HumanoidStateType.GettingUp and Humanoid:GetState() ~= Enum.HumanoidStateType.Physics) then
		RootPart:SetNetworkOwnershipAuto()
	end
end)

And here is the code to actually apply the force to the player. It’s inside of a function called Damage in a Module called “DamageManager” that runs whenever the “HardHit” parameter is true in the Damage function.

if Parameters.HardHit == true or VictimHum.Health <= 0 then
	local RagdollVelocity = Parameters.RagdollVelocity
	VictimHum:SetAttribute("Ragdoll",true)
	print(Victim.Name)
		
	print("RagdollVelocity Magnitude: "..RagdollVelocity.Magnitude)
		
	local Velocity = RagdollVelocity * VictimRoot.AssemblyMass
		
	print("AssemblyMass: "..tostring(VictimRoot.AssemblyMass))
		
	print("Velocity Magnitude: "..Velocity.Magnitude)
		
	VictimRoot:ApplyImpulse(Velocity)
end

Just to confirm, I assume the mass in the player and the mass in the NPC is the same. If not, set everything to massless when the character is added and adjust the knock back as needed.

Hope this helps!!! :happy3: