Called when the node is about to leave the SceneTree (e.g. upon freeing, scene changing, or after calling removeChild in a script). If the node has children, its _exitTree callback will be called last, after all its children have left the tree.
Corresponds to the constantNOTIFICATION_EXIT_TREE notification in GodotObject._notification and signal treeExiting. To get notified when the node has already left the active tree, connect to the treeExited.
Called when the node is about to leave the SceneTree (e.g. upon freeing, scene changing, or after calling removeChild in a script). If the node has children, its _exitTree callback will be called last, after all its children have left the tree. Corresponds to the constant NOTIFICATION_EXIT_TREE notification in GodotObject._notification and signal treeExiting. To get notified when the node has already left the active tree, connect to the treeExited.