alai/godot/goal/Goal.gd

18 lines
349 B
GDScript3
Raw Normal View History

2023-02-26 21:45:25 -03:00
extends Area2D
2023-03-01 09:19:25 -03:00
var timer := Timer.new()
func _ready() -> void:
add_child(timer)
timer.wait_time = 0.1
var err = timer.connect("timeout", self, "_on_timer_timeout")
if err == OK:
timer.start()
func _on_timer_timeout() -> void:
Event.emit_signal("report_object", self.get_name(), "not touched", global_position, Vector2())
timer.start()