Hello!
I am trying to create a movement system for my game. RN I have momentum working for when you’re moving. However, when I stop my character stops instantly. How would I go about making the character slowly stop and not stop instantly?
Here’s my code so far:
local Player = script.Parent
local Hum = Player:WaitForChild("Humanoid")
while true do wait()
if Hum.MoveDirection == Vector3.new(0, 0, 0) then
Hum.WalkSpeed = 0
print("Back Momentum")
else
if Hum.WalkSpeed < 6 then
Hum.WalkSpeed += 0.4
print("Start Move")
elseif Hum.WalkSpeed < 12 then
Hum.WalkSpeed += 0.15
print("End Move")
else
print("Move Cap")
end
end
end
Here’s a video:
Any and all help would be appreciated!