How can mouse detection follow the contours of my specific polygon?

Godot Version



I’m experiencing an issue with Area2D in Godot where the mouse_entered signal is only being triggered as if the polygon were a rectangular bounding box, despite my CollisionPolygon2D having a custom shape. How can I ensure that the mouse detection accurately follows the contours of my specific polygon shape and not just its bounding rectangle?

i tried with mouse_shape_entered signal:

then i tested both mouse entered and not, it’s the same thing, what godot full version name are you using?

1 Like

thank for your help again !!

my godot version is
Godot Engine v4.2.stable.official.46dc27791 -

yeah this one is strange, can i see your code for the mouse entered

also how do you display collision shape on runtime?

1 Like

here is my code

extends Area2D
func _on_mouse_entered():
func _on_mouse_exited():
here to display collision shape

i displayed, but it’s fine here, i read the code and how the signal is connected are both the same as mine wow

i also i checked the changelogs,from 4.2.1-rc1 to 4.2.1-stable, there are no changes in regard for this polygon or mouse entered for collision object 2d

1 Like

Your answer helped me find the problem! I switched to using the add-on physics engine Box2D because I saw on YouTube that it performs better and is more stable. I’ve been using it without any issues, so I completely forgot that it could be the reason.

Thank you so much for your help, and Happy New Year!!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.