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