Godot Version
v4.2.1.stable.mono.official [b09f793f5]
Question
I’m using ProcessMode
to pause/resume two specific nodes during runtime (one of them is paused while the other is unpaused). My code is working, but occasionally I see the below error popping up:
E 0:02:10:0481 NativeCalls.cs:331 @ void Godot.NativeCalls.godot_icall_1_37(nint, nint, int): Condition "p_elem->_root" is true.
<C++ Source> ./core/templates/self_list.h:46 @ add()
<Stack Trace> NativeCalls.cs:331 @ void Godot.NativeCalls.godot_icall_1_37(nint, nint, int)
Node.cs:1356 @ void Godot.Node.SetProcessMode(Godot.Node+ProcessModeEnum)
Node.cs:398 @ void Godot.Node.set_ProcessMode(Godot.Node+ProcessModeEnum)
MyGame.cs:167 @ void MyGame.Screens.MyGame.MyGame.OnGamePhasePauseStateChanged(object, bool)
GamePhaseDirector.cs:29 @ void MyGame.Screens.MyGame.GamePhaseDirector.set_Paused(bool)
GamePhaseDirector.cs:100 @ void MyGame.Screens.MyGame.GamePhaseDirector.ActivateGamePhase(MyGame.Screens.MyGame.GamePhaseDirector+GamePhaseTimerValues, System.Nullable`1[MyGame.Screens.MyGame.GamePhase])
MyGame.cs:180 @ void MyGame.Screens.MyGame.MyGame.OnCameraTransitionFinished(object, System.EventArgs)
HeroCamera.cs:108 @ void MyGame.Screens.MyGame.HeroCamera.<SetCameraMode>b__26_0()
HeroCamera.cs:91 @ void MyGame.Screens.MyGame.HeroCamera+<CameraTransitionToWorldView>d__25.MoveNext()
:0 @ void System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1.ExecutionContextCallback(object)
:0 @ void System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, object)
:0 @ void System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1.MoveNext(System.Threading.Thread)
:0 @ void System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1.MoveNext()
SignalAwaiter.cs:58 @ void Godot.SignalAwaiter.SignalCallback(nint, Godot.NativeInterop.godot_variant**, int, Godot.NativeInterop.godot_bool*)
The referenced code in MyGame@176 looks like this:
myNode1.ProcessMode = isPhase1 ? ProcessModeEnum.Disabled : ProcessModeEnum.Inherit;
myNode2.ProcessMode = !isPhase1? ProcessModeEnum.Disabled : ProcessModeEnum.Inherit;
The game continues to run, even with a non-debug build, but I’m uncomfortable with having mysterious errors.
The closest GitHub issue I could find was this: add: Condition "p_elem->_root" is true. error spam in connection with VisibleOnScreenEnabler2D · Issue #80073 · godotengine/godot · GitHub
What alternatives could I try to have a specific node (along with its child nodes) pause all its processing (including navigation, input and physics) instead of setting ProcessMode
?
I have tried the usual tricks like skipping a few frames and using native C# events instead of signals, but it had no effect on this error.