Godot Version
4.3
Question
I have a scene for creating visual vectors, and I want to be able to detect when I user has hovered over the vector. I have created an Area2D
with a CollisionPolygon2D
that matches the .polygon
property of the vector head exactly. I have connected the signals, and when I play the scene by itself, everything works as expected (the _on_area_2d_mouse_entered
is called once when the vector head is hovered, and _on_area_2d_mouse_exited
is called once when the mouse leaves it).
When I instance these vectors in code, however, the observed behaviour changes: hovering the vector head sees _on_area_2d_mouse_entered
called repeatedly, and leaving the vector head sees _on_area_2d_mouse_exited
called almost never (it it occasionally called, but I can’t find a pattern to when this happens).
If I instance the scene via the editor by dragging it into the tree, everything works as expected.