How to slow down a Humanoid/Player without changing their WalkSpeed

For a staff ability that adds a force to the Humanoid and slows their movements, without affecting their WalkSpeed.

I used to have a BodyPosition instance in the Player’s HumanoidRootPart that’d set the BodyPosition’s position as the root’s position and then the MaxForce of that BodyPosition acted as the force slowing the player when they tried moving.
A while ago roblox updates broke this, as now more force is applied to Humanoids which results in them not moving at all, but when the MaxForce is lowered too much then the movement’s suddenly very awkward as diagonal directions see different forces applied… (the force was consistent before)

So eh… anything else I can use to make it harder for them to move, whilst still giving them the ability to resist the force?

Is there any reason for not using walkspeed?

Main reason was so they couldn’t quickly override the lowered Speed when sprinting. The force is supposed to ‘hold’/slow them down regardless of their WalkSpeed. That’s why I opted for something independently.
Technically another reason was the cool effect BodyPosition brought, which slowly pulled the player back to the original spot when they stopped resisting (the BodyPosition’s Position)

You can rework your sprinting script to sum to the humanoid’s walkspeed instead of setting it to a specific amount. Like:
humanoid.WalkSpeed += 5
and then when they stop sprinting, just take away the amount:
humanoid.WalkSpeed -= 5
This will make it not override walkspeed changes.
The staff ability would also take away WalkSpeed like the example above instead of setting it to a specific value.

That’s exactly why I chose not to use WalkSpeed, so you can’t easily gain speed and escape quicker.
It’s supposed to be a more or less consistent force regardless of the Player’s WalkSpeed

Would you be fine with using walkspeed if there was a system to set the humanoid’s walkspeed to a set value, and update it properly when the effect wears off?

local Humanoid = Instance.new('Humanoid')--Example humanoid
	
	local OGWalkSpeed = Humanoid.WalkSpeed--Store starting walkspeed
	
	local Speed = 5
	
	Humanoid.WalkSpeed = Speed--Example value
	
	local UpdateWalkSpeed = Humanoid:GetPropertyChangedSignal('WalkSpeed'):Connect(function()
		OGWalkSpeed += Humanoid.WalkSpeed-Speed--Update OG walkspeed if the humanoid's walkspeed is attempted to be reduced or increased
		Humanoid.WalkSpeed = Speed--Set it back to the desired speed
	end)
	
	task.wait(5)--Example duration
	
	Humanoid.WalkSpeed = OGWalkSpeed
	UpdateWalkSpeed:Disconnect()

I’m not sure if this works correctly, I’m kinda new to this stuff, but I hope you get my idea!

3 Likes

It does indeed work. Thanks for the thoughts :raised_hands:

Now I’m looking for a way where it slowly pulls / nudges you back to the original spot when the staff’s ability catches you.
I’ve had DrCherenkov mention a springconstraint, but that limits how far you can move + when moving back the force on you is way less. You can feel the swaying moving when going around the spring’s base.
So that doesn’t work. Any ideas?

I recommend using a body position on the humanoid

That’s what my initial effect was like, yea! It worked perfectly

But late 2023 a bug came up where BodyPosition’s power was suddenly much less and made platforms etc. sink as they suddenly needed Human activation, which I made a report on. RadioGamer came with a good solution to change the PhysicsSteppingMethod to ‘Fixed’, which actually did fix the issue. Turns out ‘Adaptive’ had become the new Default SteppingMethod, so that’s what caused the issue.

All happy and solved until a staff member updated BodyPosition and well yes, technically fixed the sinking for the Adaptive method, making the power more firm or so and changing some stuff.
This however also affect the BodyPosition behaviour under the Fixed PhysicsSteppingMethod, adding some kind of dynamic & reactive force to it, resulting in this staff ability no longer working.

So eh… ye, it’s no longer possible now and they refuse to make any changes as they deem the old behaviour was flawed, despite allowing for these useful practices.
Reminds me a bit of the Minecraft Movement Changes (update MC-271065) and how they wanted to fix a bug many years later when it had already become a feature.


Anyway, that’s what I originally had, though that’s apparently no longer possible >_<
Or do you happen to know a way to keep the forces constant and them not differing depending on the Player/Humanoid’s movement?