move key idle waving anim out of sod

This commit is contained in:
Teatov 2025-08-13 15:17:13 +10:00
parent d609bdb21d
commit e6737223be

View File

@ -326,13 +326,8 @@ func _reset_animations() -> void:
func _animate(delta: float) -> void:
position = _pos_sod.process(delta, _animate_position())
rotation = lerp(rotation, _default_rot, delta * _rotation_damping)
func _animate_position() -> Vector3:
var new_position := _default_pos
new_position.y += (
position.y += (
sin(
(
_keyboard.anim_time
@ -344,6 +339,12 @@ func _animate_position() -> Vector3:
* _keyboard.key_size
)
rotation = lerp(rotation, _default_rot, delta * _rotation_damping)
func _animate_position() -> Vector3:
var new_position := _default_pos
new_position.y -= (_press_offset * _keyboard.key_size) if _is_pressed else 0.0
return new_position