Godot version:
3.2.1-stable_x11.64
OS/device including version:
Ubuntu 18.04
Issue description:
I'm using get_overlapping_bodies() to detect all PhysicsBody2D objects that are overlapping an Area2D. I disabled the Monitorable property of the Area2D because I don't need other areas to be aware of it. Unexpectedly, this causes get_overlapping_bodies() to ignore StaticBody2D objects.
I couldn't see anything in the documentation to suggest that the function and property are related. The documentation for get_overlapping_bodies() says that it "Returns a list of intersecting PhysicsBody2Ds", and the documentation for Monitorable only says "If true, other monitoring areas can detect this area."
This may be related to https://github.com/godotengine/godot/issues/41621, but the StaticBody2D in my example is not moving.
Steps to reproduce:
KinematicBody2D and a StaticBody2D:
[[KinematicBody2D:1174], [StaticBody2D:1176]]
Monitorable property of the Area2DKinematicBody2D:
[[KinematicBody2D:1174]]
Minimal reproduction project:
Area2DBodies.zip
I tested it with RigidBody2d, doesn't work as well. So far, RigidBody2d and StaticBody2d aren't getting detected.
This is definitely a bug, and it happens in 3D Godot physics too.
The RigidBody2D is weirder. It's detected when the scene is loaded, but it stops being detected if the Area2D's monitorable property is changed. In 3D Godot physics RigidBody is always detected.
The RigidBody2D not being detected when the monitorable property is changed is fixed with #41698.
The
RigidBody2Dnot being detected when themonitorableproperty is changed is fixed with #41698.
So, I think the bug now only revolves around StaticBody2D not being detected.
@madmiraal Does this #41698 also fixes the issue of StaticBody2d not being detected? If not, I'd like to fix this, and could you point to the direction from where I can get started?
Closing as it's a duplicate of #17238.
@theoway #41698 does not fix this issue. It's a difficult one to solve, so probably not the best one to get started with.
Most helpful comment
The
RigidBody2Dnot being detected when themonitorableproperty is changed is fixed with #41698.