What does area_set_shape_disabled mean?

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

I am working with some Area2Ds in my project and I keep getting this error:

area_set_shape_disabled: Can't change this state while flushing queries. Use call_deferrede() or set_deferred() to change monitoring state instead.

My program runs fine without any bugs, so, what does this error mean and how to fix it?

:bust_in_silhouette: Reply From: rossunger

if you set change an collision or area in code, you need to use call_deferred or set_deferred which just means that the function will be called at the end of the frame or something like that (next idle moment).

the syntax is set_deferred("propertyName", value) or call_deferred("functionName", "functionParamater - optional")

Changing collision information in the middle of the frame messes with the physics that happens that frame