0 votes

A collision shape that is a child of an Area2D node is not detecting the mouse properly - the area2d is supposed to perform an action whenever the mouse enters and exits the collision shape. There are two collision shape children of the aera2d node. When i hover the mouse above the first one, it works flawlessly. The second one, though, only activates when you hover over a specific area on the edge of the collision shape, instead of the whole collision shape as it is supposed to. I've encountered this problem before, but with a button control node, where the solution was to set the mouse filter to mouse filter ignore, however it doesn't appear to be a possibility here in an area2d and a collision shape.

Godot version 3.2.3
in Engine by (63 points)

1 Answer

0 votes
Best answer

if the 2 collisions intersects then passing from one collision to another one inside the intersections will not emit signal entered because area treats both of them as one big collision , you need to go out both collisions and then go back to the second one , you can enable visible collision shapes from the debug menu to see the collisions inside the game

by (180 points)
selected by

They do not intersect, in fact they're on opposite sides of the screen. It does not in fact intersect with any collision shape whatsoever. The CollisionShape doesn't work wherever the mouse enters from.

for me it works fine and it checks for mouse in both collisions , I'm sure there's a control node that blocks the mouse from reaching the other collision , try to open a new 2d scene and make a new test and it will work fine

func _ready() -> void:
    connect('mouse_entered', self, '_on_mouse_enter')

func _on_mouse_enter():
    print('entered')

True, I do have a rich text label in the same spot as the nonfunctional collision shape. I tried to write a bit in the _ready() function that lists through the children and if a child is a richtextlabel, it sets its mouse_filter to MOUSE_FILTER_IGNORE and it actually worked. Thanks for your help! : )

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 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 webmaster@godotengine.org with your username.