Player gets flinged when getting up from ragdoll, whereas NPC gets up normally

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

here is the ragdoll section of the combat event that plays when punching someone

maybe you could try disabling the FallingDown HumanoidState via Humanoid:SetStateEnabled()

humanoids are weird

i put it in both where the ragdoll starts and where the ragdoll ends and it still doesnt fix it

the problem is fixed now, all I had to do was set up a vector3 to their rootpart cframe when the player gets up

here is the new ragdoll code

1 Like

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.

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