Stabilize camera input across fishing and radial menus

This commit is contained in:
Alexander Sellite 2026-08-22 22:56:30 -04:00
parent 6fd1aa0388
commit 8f8398cbcd
4 changed files with 147 additions and 43 deletions

View file

@ -312,10 +312,23 @@ func _run() -> void:
Input.parse_input_event(right_stick_motion)
await process_frame
# Chat owns all movement while text entry is active, including developer
# freecam movement which reads the same WASD actions as the player.
var free_camera_body := player.get("_free_camera_body") as CharacterBody3D
assert(free_camera_body != null)
# A released fishing cast locks only the avatar. The detached camera must
# continue to accept translation while that movement lock is active.
player.set_movement_enabled(false)
var cast_locked_camera_position: Vector3 = free_camera_body.global_position
Input.action_press("move_forward")
for _frame: int in 3:
await physics_frame
Input.action_release("move_forward")
assert(not free_camera_body.global_position.is_equal_approx(
cast_locked_camera_position
))
player.set_movement_enabled(true)
# Chat owns all movement while text entry is active, including developer
# freecam movement which reads the same WASD actions as the player.
chat_ui.open_chat()
assert(chat_ui.is_open())
var free_camera_position_before: Vector3 = free_camera_body.global_position