Knockback Humanoid State Help

Hello people and devs! :wave:
How can I achieve an effect where the Target humanoid cannot move at all nor can self-animate and falls to the ground in a laying-down position (tripped)? Here is how the move looks like right now.
Here is a demonstration video:

Here is the script section regarding the effects:

for i, PCharacter in pairs(Potential) do
		local PHRP = PCharacter.HumanoidRootPart
		local PHumanoid:Humanoid = PCharacter:FindFirstChildOfClass("Humanoid")
		local PreviousState = PHumanoid:GetState()
		PHumanoid.StateChanged:Connect(function(Previous, New)
			print(Previous, New)
		end)
		PHumanoid:ChangeState(Enum.HumanoidStateType.Ragdoll)
		local KnockbackVelocity = Instance.new("LinearVelocity")
		KnockbackVelocity.Parent = PHRP
		KnockbackVelocity.MaxForce = math.huge
		KnockbackVelocity.Attachment0 = PHRP:FindFirstChildOfClass("Attachment")
		KnockbackVelocity.RelativeTo = Enum.ActuatorRelativeTo.World
		KnockbackVelocity.VectorVelocity = (Vector3.new(0,1,0))*30/0.3
		task.spawn(function()
			task.wait(0.3)
			KnockbackVelocity:Destroy()
			task.wait(BS_Settings.Server.GroundStunTime)
			PHumanoid:ChangeState(PreviousState)
		end)
	end

I want this to work on ALL humanoids. Please help :pray:
thanks for stopping by! :slight_smile:

1 Like

I’d personally disable EvaluateStateMachine and enable it back after the effect’s done over using the Ragdoll state

Also, Ragdoll won’t really trip somebody, it’ll just pretty much override the state and do nothing, you can fix that by simply applying a little forwards velocity to the player so that they’re tipped over

PHRP:ApplyImpulse(PHRP.CFrame.LookVector * force)

Mess around with the force to get the number you want

1 Like

Can you explain what EvaluateStateMachine is, I couldn’t find it for some reason:
image
Blank btw.

And how should I detect if on ground after the velocity applied?

Actually, nevermind, you don’t want to use that, since it disables the state machine altogether, the player might have weird bugs while in the animation such as being unable to die

Also, what do you want to “detect if player is on the ground” for? If you really want to make sure that the player is on the ground, I’d recommend using an animation instead over using this method

1 Like

Would keeping the Humanoid in the PlatformStand and then once they hit the ground do FallingDown work?

No, that state detects when a jump fails, which I don’t think even happens anymore

1 Like

Would you know like (predictions) on how a game like The Strongest Battlegrounds achieves this. They have the same knockback, and then once the player falls to the ground, they stay in a laying position for a bit (being stunned at the same time)?

I don’t play strongest battlegrounds, but they probably simply use an animation, just applying some force to tip the player should work too anyways most of the times

1 Like