#deacceleration and acceleration

1 messages · Page 1 of 1 (latest)

mild mauve
#

yeah i just dont know what to do lol. i just kinda want my character to slowly decrease speed in air and ground, like some bhopping thingy. i know its some weird studio thingy i have to do but this is all ive managed to come up with.
------------------------------------------------------------------------------------------------
local UserInputService = game:GetService("UserInputService")

local Character = script.Parent
local Humanoid = Character:WaitForChild("Humanoid")

while true do
task.wait()

if Humanoid.MoveDirection.Magnitude > 0 then
    -- Accelerate
    
    Humanoid.WalkSpeed = math.clamp(Humanoid.WalkSpeed + 0.5, 0, 80)
else
    -- Decelerate
    Humanoid.WalkSpeed = math.clamp(Humanoid.WalkSpeed - 0.25, 0, 80)
end

end
------------------------------------------------------------------------------------------------/
im guessing all it does is to the numbers and not the physics. anyone know anything to actually do this?

thin knot
#

ur increasing and decreasing speed by a flat amount

#

to make it feel like accelerating and decelerating, you could maybe multiply it by their speed in some mathmatical formula

#

since u should accelerate slower the faster you are and decelerate faster the slower you are