I’ve had this problem when i decided to add a ragdoll knockback. The player sometimes get flinged when theyre about to get up from a ragdoll, but the NPC gets up normally. I have no experience in using module scripts, and the ragdoll gets called from the serverside
I would suggest clamping the velocity, anchor the parts for the step where the ragdoll is initialized and then immediately unachor.
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
You could run this pretty much all of the time and it would have the affect of limiting velocity and movement speed to 20 studs per second.