Godot Version
4.4
Question
for some reason area2d (haven’t tested with others) trigger extra calls of mouse entered when it’s a child of a grid container, is this a known bug? is there a good fix?
4.4
for some reason area2d (haven’t tested with others) trigger extra calls of mouse entered when it’s a child of a grid container, is this a known bug? is there a good fix?
Maybe try:
var _temp_shape_index: int = -1
_on_mouse_shape_entered(shape_idx: int) -> void:
if _temp_shape_index == shape_idx:
return
_temp_shape_index = shape_idx
//do stuff here
_on_mouse_shape_exinted(shape_idx: int) -> void:
if _temp_shape_index == shape_idx:
_temp_shape_index = -1
This sounds more like a bug. Could you report it on the Github Godot issue tracker?
Wihout more details it is impossible to tell.
Can you clarify when the mouse_entered
signal is sent? Is it sent when you are moving the mouse inside a single Area2D?
to me it seems random, sometimes it’s sent multiple times in quick succession other times only once, it only happens when the mouse is moving. it is also within the same Area2D
just tried that, it didn’t work, although that made me realize that mouse exited is also called
ok so it seems like this might be an issue with my specific project rather than godot itself, I just tried to reproduce it on a new project (should have started with this) but I can’t recreate it. thanks for the help and ideas!