godot: Area2D/3D monitoring and monitorable are not working according to docs
Godot version: 3.1. stable
OS/device including version: Win7
Issue description:
My character scene has an attack_Area2D with a CollisionPoligon2D which I animate using the AnimationPlayer. My destructable scene has a hitbox_Area2D with a CollisionShape2D and a script for func _on_hitbox_area_entered(area): that is supposed to detect the overlapping attack_Area2D of the character scene when the character’s Animationplayer turns the attack_Area2D “on”.
Everything is on the same collision layer and mask.
According to the docs, this should work:
I have just monitorable animated on the character attack_Area2D, and monitoring on the destructable’s hitbox. But it does not work. It is not detecting. Minimal Project:
https://github.com/golddotasksquestions/Collision_Detection-only_Monitorable
The character is modulated darkred when his attack_Area2D is “hot”. Meaning this is when his attack should destroy the destructables.
By the way:
Here, I have both monitoring and monitorable animated via AnimationPlayer, while turned off by default. This works as intended, but I get the error !area_in && !E . Minimal Project:
https://github.com/golddotasksquestions/Collision_Detection-both_Monitorable_Monitoring

Here, I have monitorable and monitoring everywhere on default, while the CollisionPolygon2D is disabled and enabled via AnimationPlayer, which also does not work. It’s not detecting either. Minimal Project:
https://github.com/golddotasksquestions/Collision_Detection-collpoly_disabled

(related to this issue? https://github.com/godotengine/godot/issues/17812)
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 2
- Comments: 15 (4 by maintainers)
@MMUTFX2053 I tested your Minimal Reproduction Project in Godot 4.2 Beta2 and can confirm the behavior you are describing.
I created another example: OnEnter.zip
Both enemy and player have monitoring and monitorable set to true.
Move the player over the enemy and both detect each other.
However once you enter the enemy and press Enter which disables the player’s monitoring and monitorable, and press Enter again to re-enable, only the player detects the enemy.
Shouldn’t the enemy detect the player now that the player’s monitorable is true?
By pressing Space it disables the Area2D instead of changing monitoring or monitorable. Press again to re-enable and they both detect each other.
I would expect the behavior to be the same.
here it is, when hovering over either body or area, it should change color, but only does so when the area hovers over another area
when turning monitorable back on it works correctly
area2d_test.zip
For anyone looking into this, CollisionShapes and CollisionPolygons are also only detected when moving: https://github.com/godotengine/godot/issues/34124 Now that I think about it, #34124 seems to the reasons why no collision is detected in the last minimal Project. If I enable the movement loop in the project, the enabled/disabeled CollisionShape is detected.