GodotCourse/scripts/Trigger.gd

9 lines
175 B
GDScript3
Raw Permalink Normal View History

2024-07-29 22:14:19 +00:00
extends Area2D
@export var effect = "alert"
signal areatrigger(effect, Object)
func _on_body_entered(body):
2024-08-15 01:21:00 +00:00
if body.is_in_group("sprite"):
areatrigger.emit(effect, body)