Air control.

remotes/1705382094874458415/tmp_refs/heads/godot4-port
unfa 2020-06-14 21:19:37 +02:00
parent 1b00359d81
commit edea49ca89
1 changed files with 6 additions and 3 deletions

View File

@ -40,13 +40,16 @@ remote func walk(direction: Vector2):
interpolation = WALK_ACCEL
else:
interpolation = WALK_DECEL
if not is_on_floor():
interpolation *= AIR_CONTROL
debug.text = "Interpolation: " + String(interpolation)
debug.text += "\nwalkVelocity: " + String(walkVelocity)
debug.text += "\ncurrentVelocity: " + String(currentVelocity)
# TODO add air control multiplier for mid-air movement
debug.text += "\nis_on_floor(): " + String(is_on_floor())
velocity.x = lerp(velocity.x, walkVelocity.y, interpolation)
velocity.z = lerp(velocity.z, - walkVelocity.x, interpolation)