Godot Version
Godot4.3
Question
Hello everyone,
I am new to Godot.
I was try to make my tab box disappear if I click the mouse outside the box. However, it didn’t work. Here is the script I wrote in the node of the tab box:
func _gui_input(event: InputEvent) → void:
if event is InputEventMouseButton and event.pressed:
# Check if the mouse click occurred outside the tab box area
if not get_global_rect().has_point(event.position):
self.visible = false
Please help me point out the error or if you guys have any idea to make the box disappear.
Many Thanks.
Best regards,
Jing Sun