Velocity weaken on ragdoll character

hi!, im currently making fighting game right now
and i have come across one problem
velocity i apply to character are not stable between nonragdoll and ragdoll character


(sorry for bad quality video, im not sure why it is lagging)
velocity seem to get weaken on ragdolled character compare to nonragdolled character

i have tested many test like using impulse, apply velocity to every part of character
lower ragdoll joint friction or even set massless to every part of character
none of that work, and no one seem to have a problem like me too

this is a example of how i apply velocity and ragdoll

	local bv = Instance.new("LinearVelocity")
		bv.ForceLimitMode = Enum.ForceLimitMode.PerAxis
		bv.MaxAxesForce = Property.VelocityForce
		bv.VectorVelocity = Property.Velocity
		bv.Attachment0 = RootAtt
		bv.RelativeTo = Enum.ActuatorRelativeTo.World
		bv.Parent = VictimRoot

		RSModule.Debris:AddItem(bv, Property.VelocityDuration)
local SocketProperty = {
	["RootJoint"] = {
		{"LimitsEnabled", true},
		{"TwistLimitsEnabled", true},
		{"MaxFrictionTorque", 0},--100
		{"UpperAngle", 0},
		{"TwistLowerAngle", 0},
		{"TwistUpperAngle", 0},
	},
	["Neck"] = {
		{"LimitsEnabled", true},
		{"MaxFrictionTorque", 150},
		{"TwistLimitsEnabled", true},
	},
	["Left Hip"] = {
		{"LimitsEnabled", true},
		{"MaxFrictionTorque", 150},
		{"TwistLimitsEnabled", true},
		{"UpperAngle", 50},
		{"TwistLowerAngle", -25},
		{"TwistUpperAngle", 25},
	},
	["Right Hip"] = {
		{"LimitsEnabled", true},
		{"MaxFrictionTorque", 150},
		{"TwistLimitsEnabled", true},
		{"UpperAngle", 50},
		{"TwistLowerAngle", -25},
		{"TwistUpperAngle", 25},
	},
	["Left Shoulder"] = {
		{"LimitsEnabled", true},
		{"MaxFrictionTorque", 100},
		{"Restitution", 1},
	},
	["Right Shoulder"] = {
		{"LimitsEnabled", true},
		{"MaxFrictionTorque", 100},
		{"Restitution", 1},
	}
}
	humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp, false)
	humanoid:ChangeState(Enum.HumanoidStateType.Physics)

I don’t really see a way to solve this, the only thing coming to mind is cloning them and then making them ragdolled and the non ragdolled clone is invisible and has the velocity, then in a loop update the CFrame of the ragdolled one to the non ragdolled one.

1 Like

hi, i might have found a solution now
when i calculate for velocity, it depend on character’s assemblymass
nonragdoll character assemblymass is around 11.8
while ragdoll character assemblymass is around 2.8
resulting velocity getting weaken on it own

thank you!

EDIT: i fixed the issue by getting totalmass from every part inside character
this is a simple module i made

return function(c)
	local totalmass = 0
	for _, v in c:GetChildren() do
		if v:IsA("BasePart") then
			totalmass += v:GetMass()
		end
	end
	
	return totalmass
end

That solution appears great! I alternatively use this function to constrain the linear velocity for my ragdolls if they are a player.

local VelocityConstraint=20
					local function constrainsum(v)
						local x,y,z=v.X,v.Y,v.Z
						if x>VelocityConstraint then
							x=VelocityConstraint
						elseif x<-VelocityConstraint then 
							x=-VelocityConstraint
						end
						if y>VelocityConstraint then
							y=VelocityConstraint	
						elseif y<-VelocityConstraint then 
							y=-VelocityConstraint	
						end
						if z>VelocityConstraint then
							z=VelocityConstraint
						elseif z<-VelocityConstraint then 
							z=-VelocityConstraint
						end
						return Vector3.new(x,y,z)
					end
					for i,v in velocities do
						local constrain=constrainsum(v.AssemblyLinearVelocity)
			if constrain~=v.AssemblyLinearVelocity then	
				v.AssemblyLinearVelocity=constrain
				end	

On the client I’m using the Run Service PreSimulation hook to calculate the constrained velocity before the physics simulation. Additionally, only writing to the velocity if it exceeds the threshold.

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