GodotCourse/scripts/Trigger.gd

10 lines
210 B
GDScript

extends Area2D
@export var effect = "alert"
signal areatrigger(effect, Object)
func _on_body_entered(body):
print("detected a body")
if body.get_collider() != StaticBody2D:
areatrigger.emit(effect, body)