Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| eea5cc4e4c | |||
| e6737223be |
@ -326,13 +326,8 @@ func _reset_animations() -> void:
|
|||||||
|
|
||||||
func _animate(delta: float) -> void:
|
func _animate(delta: float) -> void:
|
||||||
position = _pos_sod.process(delta, _animate_position())
|
position = _pos_sod.process(delta, _animate_position())
|
||||||
rotation = lerp(rotation, _default_rot, delta * _rotation_damping)
|
|
||||||
|
|
||||||
|
position.y += (
|
||||||
func _animate_position() -> Vector3:
|
|
||||||
var new_position := _default_pos
|
|
||||||
|
|
||||||
new_position.y += (
|
|
||||||
sin(
|
sin(
|
||||||
(
|
(
|
||||||
_keyboard.anim_time
|
_keyboard.anim_time
|
||||||
@ -344,6 +339,12 @@ func _animate_position() -> Vector3:
|
|||||||
* _keyboard.key_size
|
* _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
|
new_position.y -= (_press_offset * _keyboard.key_size) if _is_pressed else 0.0
|
||||||
|
|
||||||
return new_position
|
return new_position
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user