From 0513c3a3a6b6a3165cd347ab665b5b1901ae4f3c Mon Sep 17 00:00:00 2001 From: blujai831 Date: Sat, 29 Mar 2025 11:30:52 -0700 Subject: [PATCH] Disable mouse controls when the game window is embedded in the editor --- characters/base/character.gd | 1 - vfx/gameplay_camera.gd | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/characters/base/character.gd b/characters/base/character.gd index 4f17837..d843d9a 100644 --- a/characters/base/character.gd +++ b/characters/base/character.gd @@ -1321,7 +1321,6 @@ func _on_throw_state_tick(_delta: float) -> void: if _state_animation_done(): if _carrying: _put_down_without_animation() - _carrying = null force_change_state(&'run') elif _carrying && ( _anim_player.current_animation_position / diff --git a/vfx/gameplay_camera.gd b/vfx/gameplay_camera.gd index 0488f76..aff1167 100644 --- a/vfx/gameplay_camera.gd +++ b/vfx/gameplay_camera.gd @@ -29,13 +29,13 @@ func _ready() -> void: snap_to_target() func _update_mouse_mode() -> void: - if player_control: + if player_control && !Engine.is_embedded_in_editor(): Input.mouse_mode = Input.MOUSE_MODE_CAPTURED else: Input.mouse_mode = Input.MOUSE_MODE_VISIBLE func _unhandled_input(event: InputEvent) -> void: - if !player_control: return + if !player_control || Engine.is_embedded_in_editor(): return var move_event := event as InputEventMouseMotion var button_event := event as InputEventMouseButton if move_event: