How to make player movement accelerate and deaccelerate?

I am trying to make my character move smoother in game. I am trying to make it where people can jump to run faster, and also have a little bit of smoothing instead of people just stopping as soon as they stop. I’ve tried other discussions, but I’m trying to look for a simple code so I can tweak it.

Here is what I have so far. The code is very delicate with numbers. These two videos show what happened when I changed the code numbers by 1/10th

And here is the code. If this doesn’t work out I can try another code.

local character = game.Players.LocalPlayer.Character

-- de accelerate physics
local idle = false
local lastvelocity = Vector3.new(0,0,0)

while game:GetService("RunService").Heartbeat:Wait() do
	
	if idle == false then
		lastvelocity = character.HumanoidRootPart.Velocity * 3
	else
		lastvelocity = lastvelocity * 0.7
		character.HumanoidRootPart.Velocity = character.HumanoidRootPart.Velocity + lastvelocity
	end
	
-- idle check
	if character.Humanoid.MoveDirection.Magnitude == 0 then
		idle = true
	else
		idle = false
	end
end

Sorry, but I’m not understanding it too well. Is there a video on what you want to happen?

This is my desired output. It uses custom physical properties which is a bug for my npc’s

1 Like

bump (i am so sorry if this isnt allowed this is my first time on dev forum)

bump (very sorry again I’m have a scheduled release date)

What’s the bug? CustomPhysicalProperties seem to work on my NPC.

the bug is that i dont want the NPC’s to have slide, only the players. also I have jump physics that mess up when i use custom physical properties, so i just want to use velocity or bodyforce if needed to slide the players.

bumpㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ

what if you change the player’s CustomPhysicalProperties and not the npc’s or the baseplate