Getting Error messages in output.:-
E 0:00:03:0676 level.gd:53 @ _on_exit_body_entered(): This function can’t be used during the in/out signal.
- <C++ Error> Condition “locked” is true.
- <C++ Source> scene/2d/area_2d.cpp:328 @ _clear_monitoring()*
- level.gd:53 @ _on_exit_body_entered()*
E 0:00:03:0676 level.gd:53 @ _on_exit_body_entered(): Removing a CollisionObject node during a physics callback is not allowed and will cause undesired behavior. Remove with call_deferred() instead.
- <C++ Source> scene/2d/collision_object_2d.cpp:98 @ _notification()*
- level.gd:53 @ _on_exit_body_entered()*
Checked Godot 4.2 documentation and it mentions using call_defered() with Get_tree().reload_scene().
So used this below:-
get_tree().change_scene_to_packed.bind(next_level).call_deferred()
Get no errors now, is this a bug in the new Godot 4.2.2 or is it the proper way to do this?