From 9b5317504a29b9c15ecc2540708a7ee94310d2b7 Mon Sep 17 00:00:00 2001 From: Fernando Castellanos <35811031+fernacas-dev@users.noreply.github.com> Date: Tue, 23 Dec 2025 16:45:37 -0300 Subject: [PATCH] Add return statement after pausing the game After Pause mode kicks in, we don't need to run the rest of this function. I was hitting a crash because the checks below this part were still executing --- .../snippets/gamescene/checkkeyboardinput.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/articles/tutorials/building_2d_games/20_implementing_ui_with_gum/snippets/gamescene/checkkeyboardinput.cs b/articles/tutorials/building_2d_games/20_implementing_ui_with_gum/snippets/gamescene/checkkeyboardinput.cs index 9952b252..45ec1309 100644 --- a/articles/tutorials/building_2d_games/20_implementing_ui_with_gum/snippets/gamescene/checkkeyboardinput.cs +++ b/articles/tutorials/building_2d_games/20_implementing_ui_with_gum/snippets/gamescene/checkkeyboardinput.cs @@ -7,7 +7,8 @@ private void CheckKeyboardInput() if (Core.Input.Keyboard.WasKeyJustPressed(Keys.Escape)) { PauseGame(); + return; } // Existing keyboard input code - // ... \ No newline at end of file + // ...