Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Area2D/3D monitoring and monitorable are not working according to docs #27441

Closed
Tracked by #45334 ...
golddotasksquestions opened this issue Mar 26, 2019 · 15 comments · Fixed by #41698
Closed
Tracked by #45334 ...

Area2D/3D monitoring and monitorable are not working according to docs #27441

golddotasksquestions opened this issue Mar 26, 2019 · 15 comments · Fixed by #41698

Comments

@golddotasksquestions
Copy link

golddotasksquestions commented Mar 26, 2019

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
only-monitoring
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
both-monitoring_monitorable

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
collpol_disabeled

(related to this issue? #17812)

@Raphael2048
Copy link
Contributor

Maybe related to #23484

@volzhs volzhs unpinned this issue May 27, 2019
@noidexe
Copy link
Contributor

noidexe commented Oct 26, 2019

I'm having exactly the same issue. I tried getting overlapping areas and it doesn't work either.
I haven't checked the source code but it's as if areas are only checked for overlaps when their active and they move.

@kickmaniac
Copy link

I ended up manually switching monitoring/monitorable off and on to update overlapping areas array.

@svendixon
Copy link

svendixon commented Nov 6, 2019

2019-11-06 00-22-17

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.

@golddotasksquestions
Copy link
Author

golddotasksquestions commented Dec 30, 2019

For anyone looking into this, CollisionShapes and CollisionPolygons are also only detected when moving: #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.

@golddotasksquestions
Copy link
Author

I'm closing this as I don't seem to be able to replicate this issue in Godot 3.2.stable any more. (Win)
If someone else still has it please let me know and comment, to reopen it.

@akien-mga akien-mga added this to the 3.2 milestone Jan 31, 2020
@golddotasksquestions
Copy link
Author

golddotasksquestions commented Jan 31, 2020

I have to reopen this as monitorable and monitoring still don't seem to behave consistent in situations when both Areas are not moving:

u/Armanlex on Reddit pointed out that they still get a different behavour when they include position=position compared to when they don't include it (exit signal not firing when monitorable is turned off):

monitorable_behaviour1

The monitoring behaviour also does not seem to be consistent monitorable when turned on and off while not moving:

monitorable_monitoring_inconsist1

Minimal Project for anyone who would like to try:
MonitoringMonitorable_Armanlex.zip

@akien-mga akien-mga removed this from the 3.2 milestone Jan 31, 2020
@pouleyKetchoupp pouleyKetchoupp changed the title Area2D monitoring and monitorable are not working according to docs Area2D/3D monitoring and monitorable are not working according to docs Apr 7, 2021
@akien-mga akien-mga added this to the 4.0 milestone Nov 20, 2021
@MMUTFX2053
Copy link

this bug still exists in 4.1.2, i made a bullet scene from an area2d, with monitorable turned off, it doesnt detect anything

@golddotasksquestions
Copy link
Author

@MMUTFX2053 Can you please share a minimal reproduction project?

@MMUTFX2053
Copy link

MMUTFX2053 commented Oct 15, 2023

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

@golddotasksquestions
Copy link
Author

@MMUTFX2053 I tested your Minimal Reproduction Project in Godot 4.2 Beta2 and can confirm the behavior you are describing.

@gregkrsak
Copy link

Also running into this bug. Hoping for a fix in 4.3

@Calinou
Copy link
Member

Calinou commented Jan 3, 2024

Please continue the discussion in #66468 or #74300.

@gregkrsak
Copy link

Please continue the discussion in #66468 or #74300.

Those two issues deal specifically with Area3D nodes, while I am seeing an issue with Area2D nodes.

@AThousandShips
Copy link
Member

AThousandShips commented Jan 3, 2024

No same issue, see the thread (#66468 (comment)), it's not just for 3d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants