Browse Source

Truly pause game in XR start script tutorial

David Snopek 1 year ago
parent
commit
7e0bbcaf70
1 changed files with 4 additions and 4 deletions
  1. 4 4
      tutorials/xr/a_better_xr_start_script.rst

+ 4 - 4
tutorials/xr/a_better_xr_start_script.rst

@@ -331,7 +331,7 @@ If you haven't, you can connect a method to the signal that performs additional
             xr_is_focussed = false
             xr_is_focussed = false
 
 
             # pause our game
             # pause our game
-            process_mode = Node.PROCESS_MODE_DISABLED
+            get_tree().paused = true
 
 
             emit_signal("focus_lost")
             emit_signal("focus_lost")
  
  
@@ -355,7 +355,7 @@ If you haven't, you can connect a method to the signal that performs additional
                 _xrIsFocused = false;
                 _xrIsFocused = false;
 
 
                 // Pause our game
                 // Pause our game
-                ProcessMode = ProcessModeEnum.Disabled;
+                GetTree().Paused = true;
 
 
                 EmitSignal(SignalName.FocusLost);
                 EmitSignal(SignalName.FocusLost);
             }
             }
@@ -395,7 +395,7 @@ While handling our signal we will update the focusses state, unpause our node an
         xr_is_focussed = true
         xr_is_focussed = true
 
 
         # unpause our game
         # unpause our game
-        process_mode = Node.PROCESS_MODE_INHERIT
+        get_tree().paused = false
 
 
         emit_signal("focus_gained")
         emit_signal("focus_gained")
 
 
@@ -414,7 +414,7 @@ While handling our signal we will update the focusses state, unpause our node an
             _xrIsFocused = true;
             _xrIsFocused = true;
 
 
             // Un-pause our game
             // Un-pause our game
-            ProcessMode = ProcessModeEnum.Inherit;
+            GetTree().Paused = false;
 
 
             EmitSignal(SignalName.FocusGained);
             EmitSignal(SignalName.FocusGained);
         }
         }