Godot Version
4.3.5
Question
(Issue depicted in linked video)
I have an area2d with 2 collisionshape2d children, one of which is supposed to move around to the location of a different UI element. What’s supposed to happen is when the mouse cursor is outside of the area it hides the element, but instead this behavior only occurs if the collisionshape2d is in the same general location it was when it started.
Both of the collision shapes visible in the video are a child of the same area2d, which are in turn a child of a Control node.
Code that updates the shape’s location:
collision_shape_destroy.position.y = destroy.position.y + 11.5 collision_shape_destroy.position.x = destroy.position.x + 52
Code that hides the UI when the cursor exits the area (connected to the area’s mouse_exited signal):
func _on_area_mouse_exited():
destroy.visible = false
No other code is relevant to this problem, I’ve already checked.