I am using lerp function to make smooth movement in my game, but after player releases the button it is decreasing to 0 for 3 seconds, is there a way to equalize it to 0 after it reaches 0.01?
I've tried this method, but it just isn't working
vel.x = lerp(vel.x, dir.x * accseleration, 0.2)
vel.z = lerp(vel.z, dir.z * accseleration, 0.2)
if vel.x <= 0.01:
vel.x == 0
also I've tried rounding it to 0.01 but just stops at 0,05 and stays like that until player presses a button again