Hi everyone. I'm doing simple work with area node but every time I collide with I get error below :

0:00:08:0232 - Condition ' !is_inside_tree() ' is true. returned: Transform() Type:Error Description: Time: 0:00:08:0232 C Error: Condition ' !is_inside_tree() ' is true. returned: Transform() C Source: scene\3d\spatial.cpp:268 C Function: Spatial::get_global_transform

It happens when following code is executed yellow_cube_explosion_instance.global_transform.origin = Vector3(body.global_transform.origin.x,body.global_transform.origin.y + 1.2,body.global_transform.origin.z) According to error, node is not is in tree at the moment... It is even possible ? Everything in scene is in scene tree how the heck is possible to not be inside tree ?Do someone help me to solve this problem ? ps. Tried call_deferred, it won't help. Thanks -Garrom

It should happen if you try to execute code before the node enters the tree and depends on it (like using _init function, or if you call a function of your node before add_child and that function tries to reference SceneTree).

@arthur said: It should happen if you try to execute code before the node enters the tree and depends on it (like using _init function, or if you call a function of your node before add_child and that function tries to reference SceneTree).

Yes, I calling it before adding child object so added child object will be added on right position. It worked before, within local space. What are you trying to say is I can manipulate local space before adding child object but I cannot manipulate global space ?

Since it is not on tree, it's not possible to calculate global space (it depends on parent nodes which, well, doesn't exist until you add to scene tree).

5 years later