Hello,
in Godot 4.2.1 when exiting the maze I got this list of errors:
level.gd:10 @ _on_maze_body_exited(): This function can't be used during the in/out signal.
level.gd:10 @ _on_maze_body_exited(): Removing a CollisionObject node during a physics callback is not allowed and will cause undesired behavior. Remove with call_deferred() instead.
can_process: Condition "!is_inside_tree()" is true. Returning: false
When googling the error, the proposed solution was to use the call_deffered() function as one of the errors suggests. The function then looks like this:
func _on_maze_body_exited(body):
get_tree().call_deferred("reload_current_scene")
This removed the errors but I don’t understand why I received the errors, what they mean and why using the call_deferred() function fixed them. Is it related to the newer version of Godot I’m using or did I do anything wrong?