Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Andrea |
Hello,
I´m using 3 collision layers in my project: player, enemies, walls.
The playable character has a meele attack, which is linked to an Area2D node that scans the area for bodies around.
I found out there is something strange with this node: no matter what collision mask i set, it never fires any signal, UNLESS i also set at least 1 collision layer (which i dont plan to use btw) equal to a collision mask. In this case, the signal ONLY detect the presence of the player node and the player node only, no matter what layer/mask i chose, if they are the same the player is detected the others are not.
Is it a bug or am I doing something wrong?
This issue is difficult to solve. Perhaps a screenshot of your collision settings would help?
Edit: also of note: Area2D
, KinematicBody2D
, and StaticBody2D
work a little bit differently from each other. That could also be a source of your problem.
Ertain | 2018-10-31 06:57
I´ve done a test project which is very close to my original one, you can find it here:
Collision area test – Google Drive
I played with it a little and I understood the problem is related with the Area2D “monitorable” flag: if you uncheck it, the collision with a body is only detected if the other body detects it (which is wrong since the other body should not detect any collision, being the area not-monitorable)
On the other hand if you check monitorable and uncheck monitoring, no signal is fired no matter what.
I´m struggling to understand the results of these combos of monitoring-monitorable/layer-mask, if you could help it would be great!
Andrea | 2018-10-31 11:15