I want to make it so you have to press W when airstrafing or else it will only be use full for redirection.
Think “Evade” the Roblox game.
My current code:
func air(delta):
velocity.y -= gravity * delta
var speed_in_dir = velocity.dot(dir)
var capped_speed = min((air_speed * dir).length(), air_cap)
var add_speed = capped_speed - speed_in_dir
var accel_speed = air_accel * air_speed * delta
if add_speed > 0:
accel_speed = min(accel_speed, add_speed)
self.velocity += accel_speed * dir