You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After I upgraded my Godot version from 4.2dev3 to 4.2dev5 I encountered the issue that the tree_exited signal fires on nodes that have my custom C# script attached but it somehow already "forgot" that the Node actually had my script attached. So I get the error emit_signalp: Error calling from signal 'tree_exited' to callable: 'Node2D::_on_tree_exited': Method not found. <C++ Source> core/object/object.cpp:1125 @ emit_signalp()
The same problem leads to the fact that my public override void _ExitTree() method in my script does not even run at all.
Steps to reproduce
Create a node with a C# script attached to it that implements either _ExitTree() or where the scene is connected to the tree_exited signal (calling a method on the same scene)
Put debug prints into the signal-connected method or the _ExitTree() one
Create a wrapper scene which contains the first scene
Let the node of the first scene get removed by calling QueueFree() when clicking a button or pressing any key
Get errors (in signal case) or no printing at all (in _ExitTree() case)
Minimal reproduction project
Start the project and click the button. Notice that we don't get the log message from _ExitTree() and also an error from the tree_exited signal connection. tree-exit-bug.zip
The text was updated successfully, but these errors were encountered:
juse4pro
changed the title
C#: Script methods bound to tree_exited / can't be found.
C#: Script methods bound to tree_exited / _ExitTree() can't be found.
Sep 25, 2023
Godot version
v4.2.dev5.mono.official [e3e2528]
System information
Windows 11
Issue description
After I upgraded my Godot version from 4.2dev3 to 4.2dev5 I encountered the issue that the
tree_exited
signal fires on nodes that have my custom C# script attached but it somehow already "forgot" that the Node actually had my script attached. So I get the erroremit_signalp: Error calling from signal 'tree_exited' to callable: 'Node2D::_on_tree_exited': Method not found. <C++ Source> core/object/object.cpp:1125 @ emit_signalp()
The same problem leads to the fact that my
public override void _ExitTree()
method in my script does not even run at all.Steps to reproduce
_ExitTree()
or where the scene is connected to thetree_exited
signal (calling a method on the same scene)_ExitTree()
oneQueueFree()
when clicking a button or pressing any key_ExitTree()
case)Minimal reproduction project
Start the project and click the button. Notice that we don't get the log message from
_ExitTree()
and also an error from thetree_exited
signal connection.tree-exit-bug.zip
The text was updated successfully, but these errors were encountered: