What does "area_set_shape_disabled" mean in relation to my code?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By wolvertox

From my understanding this is only an error when an areas collision is changed but I don’t think I did that, at least not intentionally.

func player_damaged_screenclear():
var screen_clear = pl_damage_screenclear.instance()
get_tree().current_scene.add_child(screen_clear) 
    ^ the specific line that errors
screen_clear.global_position = hitbox.global_position
:bust_in_silhouette: Reply From: Gangster53 YT

As I understand it;
"get_tree().current_scene.add_child(screen_clear) "
where it says you want to add a node to your scene. If so, replace it with;

-If this script belongs to the stage root:

add_child(screen_clear)

-But if it belongs to a node one below the root:

get_parent().add_child(screen_clear)

I hope I have helped you. have a nice day.

It didn’t work unfortunately and it still gives the same error.

wolvertox | 2022-12-06 00:33

:bust_in_silhouette: Reply From: wolvertox

I was able to figure it out myself. If I replaced:

get_tree().current_scene.add_child(screen_clear) 

with

get_tree().current_scene.call_deferred("add_child", screen_clear)