Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | RZaga09 |
I have an Area2D node and in the script I try to connect it’s parent node (also an Area2D) to a signal.
extends Area2D
onready var swipeDetector = get_tree().get_root().get_node("mainScene").get_node("swipeDetector")
func _ready():
get_parent().connect("mouse_exited", get_parent(), "onMouseOutOfRange")
func onMouseOutOfRange():
swipeDetector.outOfRange = true
But when I try to run it I get this error:
E 0:00:02.592 emit_signal: Error calling method from signal 'mouse_exited': 'Area2D::onMouseOutOfRange': Method not found..
<C++ Source> core/object.cpp:1228 @ emit_signal()
Anyone know what I can do to fix this?