jump ani fixing and transition animations

This commit is contained in:
Nicholas Butzke
2026-08-10 12:50:00 -04:00
parent 833e936bcd
commit 0ce626ad42
13 changed files with 359 additions and 35 deletions
+10 -5
View File
@@ -52,11 +52,8 @@ func update(delta: float) -> void:
# ── Horizontal movement (exponential interpolation for smoothness) ───
var hvel := Vector3(vel.x, 0.0, vel.z)
var target_vel := wish_dir * effective_speed
if wish_dir.length_squared() > 0.0:
hvel = hvel.lerp(target_vel, 1.0 - exp(-params.ground_acceleration * delta))
else:
hvel = hvel.lerp(Vector3.ZERO, 1.0 - exp(-params.ground_deceleration * delta))
hvel = _next_horizontal_velocity(
hvel, target_vel, wish_dir.length_squared() > 0.0, delta)
vel.x = hvel.x
vel.z = hvel.z
@@ -127,6 +124,14 @@ func update(delta: float) -> void:
return
func _next_horizontal_velocity(current: Vector3, target: Vector3,
has_input: bool, delta: float) -> Vector3:
var response := params.ground_acceleration \
if has_input else params.ground_deceleration
return current.lerp(target if has_input else Vector3.ZERO,
1.0 - exp(-response * delta))
func _try_step_up(player: CharacterBody3D, wish_dir: Vector3, hvel: Vector3) -> void:
for i in range(player.get_slide_collision_count()):
var col = player.get_slide_collision(i)