+1 vote

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?

in Engine by (1,514 points)
edited by

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.

I´ve done a test project which is very close to my original one, you can find it here:

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!

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.