Godot v4.3
I’m trying to detect when the mouse enters or leaves an Area2D. However, the signal functions aren’t even being called. Here’s my nodes and codes.
extends Node2D
func _ready():
pass
Called every frame. ‘delta’ is the elapsed time since the previous frame.
func _process(delta: float) → void:
pass
func _on_area_2d_mouse_entered() → void:
print(“Mouse Entered”) # Debugging
$Sprite2D.scale = Vector2(1.05,1.05)
func _on_area_2d_mouse_exited() → void:
print(“Mouse Exited”) # Debugging
$Sprite2D.scale = Vector2(1.0,1.0)
- There doesn’t seem to be anything else that could be consuming input.
- Visible and Pickable set to On, collision layer and mask set to 1.
- I’ve double-checked that the signals are linked to the correct script.
I’ve even done this before and had it work, but I can’t see any difference in code between that project and this one, so I assume it must be some setting that is causing the problem.