Problem
freeing a child node (with a scatter node in it) after removing it from a tree causes null exception.
Description
Assume I have a tree, with a child node in it. This child node has a scatter node in it. If I try to remove the child node from the tree, and then try to free the node, there will be a null exception in _on_transforms_ready at await get_tree().process_frame, because the node is no longer in a tree.
Solution
Check if the tree exists before processing frame.
I'm not sure if this is the correct way to do it, but it lets me do what I wanted to do (free object after removing it from a tree)
Problem freeing a child node (with a scatter node in it) after removing it from a tree causes null exception.
Description Assume I have a tree, with a child node in it. This child node has a scatter node in it. If I try to remove the child node from the tree, and then try to free the node, there will be a null exception in
_on_transforms_ready
atawait get_tree().process_frame
, because the node is no longer in a tree.Solution Check if the tree exists before processing frame.
I'm not sure if this is the correct way to do it, but it lets me do what I wanted to do (free object after removing it from a tree)