You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Operating system or device - Godot version:
Arch linux 64 - 2.2 branch
Issue description (what happened, and what was expected):
When you have an Area2D and another Area2D or a PhysicsBody overlapping and set that they report collisions to each other, and you remove the Area2D from the tree (with remove_child()), you get errors like
ERROR: _body_inout: Condition ' !body_in && !E ' is true ...
or
ERROR: _body_inout: Condition ' !area_in && !E ' is true ...
call_deferred("remove_child", child) does NOT work here. It seems that they try to report another collider leaving the area although they are already removed from the scene.
The only ways for me to fix that were to use set_monitoring_enabled() in _enter_tree and _exit_tree or set them to different layers/masks (which is not a solution, they have to collide for gameplay reasons).
I already made a fix for that, using the monitoring solution from above (which I will make a pull request for as soon as the second problem is solved).
When having multiple overlapping Area2Ds (and optionally PhysicsBodies) as children of one parent node in the scene, removing this parent node from the scene with remove_child() without freeing it and readding it after that will cause errors:
Condition ' !E ' is true
and in some cases also
Signal enter/exit_tree already connected to given method _area_enter_tree in that object.
All of those are thrown in area_2d.cpp when re-adding the Area2ds to the scene. So for some reason the connections aren't removed when removing the parent node is removed. But I'm still trying to figure out what causes the first error. And what is even weirder, if you make the Area2D's not overlap anymore after the errors have been thrown and you redo the whole thing, more errors are thrown although they should not be reporting collisiosn to each other anymore. call_deferred() doesn't work here either.
I'm trying to fix this right now, if anyone has any hints regarding that, that would be helpful.
None of those problems occur if you just queue_free() them and reinstance them, but I like to keep my player object and my levels (that are just instanced children of a parent world node whichs has the UI and stuff) instanced when switching them, so they are in the same state as before when they get reloaded into the world.
Steps to reproduce:
bug: Make two or more Area2Ds, let them overlap. Remove one of them using remove_child()
bug: Make two or more Area2Ds as children of a parent node, let them overlap. Remove and re-add the parent node with a script (this will likely also cause the 1. bug)
The text was updated successfully, but these errors were encountered:
Operating system or device - Godot version:
Arch linux 64 - 2.2 branch
Issue description (what happened, and what was expected):
remove_child()
), you get errors likecall_deferred("remove_child", child)
does NOT work here. It seems that they try to report another collider leaving the area although they are already removed from the scene.The only ways for me to fix that were to use
set_monitoring_enabled()
in_enter_tree
and_exit_tree
or set them to different layers/masks (which is not a solution, they have to collide for gameplay reasons).I already made a fix for that, using the monitoring solution from above (which I will make a pull request for as soon as the second problem is solved).
remove_child()
without freeing it and readding it after that will cause errors:All of those are thrown in area_2d.cpp when re-adding the Area2ds to the scene. So for some reason the connections aren't removed when removing the parent node is removed. But I'm still trying to figure out what causes the first error. And what is even weirder, if you make the Area2D's not overlap anymore after the errors have been thrown and you redo the whole thing, more errors are thrown although they should not be reporting collisiosn to each other anymore.
call_deferred()
doesn't work here either.I'm trying to fix this right now, if anyone has any hints regarding that, that would be helpful.
None of those problems occur if you just
queue_free()
them and reinstance them, but I like to keep my player object and my levels (that are just instanced children of a parent world node whichs has the UI and stuff) instanced when switching them, so they are in the same state as before when they get reloaded into the world.Steps to reproduce:
The text was updated successfully, but these errors were encountered: