How to make character slow to a stop

I want to make the character slow to a stop after walking/running. I guess you could say kind of like ice. If you don’t know what I mean here is an example of a game that uses this mechanic: Evade - Roblox

I have tried adding a body velocity when the player stops moving which doesn’t look very nice ( possibly just doing it wrong).

Any help is greatly appreciated :smile:

3 Likes

Are you taking about a sliding ability?

1 Like

Don’t understand what you mean by this. But what I’m trying to say is when you stop moving forward (let go of “W” for example) you slide a bit before coming to a complete stop.

1 Like

Alright then, make a new local cript and put it in StarterCharacterScripts and make the script this:



local uis = game:GetService("UserInputService")


uis.InputBegan:Connect(function(inp, processed)
	
	if processed then return end
	
	
	if inp.KeyCode == Enum.KeyCode.LeftControl then
		
		
		
		humanoid.HipHeight = 0.3
	end
end)


uis.InputEnded:Connect(function(inp)

	if inp.KeyCode == Enum.KeyCode.LeftControl then

		
		
		humanoid.HipHeight = 2
	end
end)

This means it will activate if you press LeftControl

1 Like

I meant that when you stop moving, so It is activated when you stop pressing forward not when a key is pressed. I will just tweak your code a bit.

1 Like

I found the solution: align position and just change final position to the humanoid move direction times the speed divided by 2.5.

6 Likes

You could just tween their humanoid’s ‘WalkSpeed’ property down to 0.

1 Like

One question, how do u check if the player is moving? Humanoid.Running?

ye or

humanoid.MoveDirection.Magnitude > 0
2 Likes