From 99d22d6f42957ae4bab4c248a670f95b4e1f41b8 Mon Sep 17 00:00:00 2001 From: Fernando Castellanos <35811031+fernacas-dev@users.noreply.github.com> Date: Tue, 23 Dec 2025 16:45:29 -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/checkgamepadinput.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/articles/tutorials/building_2d_games/20_implementing_ui_with_gum/snippets/gamescene/checkgamepadinput.cs b/articles/tutorials/building_2d_games/20_implementing_ui_with_gum/snippets/gamescene/checkgamepadinput.cs index 0654bb9e..f1049dc2 100644 --- a/articles/tutorials/building_2d_games/20_implementing_ui_with_gum/snippets/gamescene/checkgamepadinput.cs +++ b/articles/tutorials/building_2d_games/20_implementing_ui_with_gum/snippets/gamescene/checkgamepadinput.cs @@ -7,7 +7,8 @@ private void CheckGamePadInput() if (gamePadOne.WasButtonJustPressed(Buttons.Start)) { PauseGame(); + return; } // Existing gamepad input code - // ... \ No newline at end of file + // ...