fix: correct axis direction, air accel, and jump/dash input handling
This commit is contained in:
@@ -22,7 +22,7 @@ func update(delta: float) -> void:
|
||||
|
||||
# Input direction
|
||||
var input_v := machine.input_dir
|
||||
var wish_dir := Vector3(input_v.x, 0.0, -input_v.y)
|
||||
var wish_dir := Vector3(input_v.x, 0.0, input_v.y)
|
||||
if wish_dir.length_squared() > 1.0:
|
||||
wish_dir = wish_dir.normalized()
|
||||
|
||||
@@ -31,7 +31,7 @@ func update(delta: float) -> void:
|
||||
var hvel := Vector3(vel.x, 0.0, vel.z)
|
||||
var target_vel := wish_dir * effective_speed * params.air_control
|
||||
|
||||
hvel = hvel.lerp(Vector3(hvel.x + target_vel.x, 0.0, hvel.z + target_vel.z), 1.0 - exp(-params.air_acceleration * delta))
|
||||
hvel = hvel.lerp(target_vel, 1.0 - exp(-params.air_acceleration * delta))
|
||||
|
||||
vel.x = hvel.x
|
||||
vel.z = hvel.z
|
||||
|
||||
Reference in New Issue
Block a user