FebGame/febfabgame/Scripts/trigger.gd

19 lines
450 B
GDScript3
Raw Permalink Normal View History

class_name Trigger extends Area2D
@export var effect="alert"
2025-02-25 02:10:45 +00:00
signal areaTrigger(effect, Object)
2025-02-25 02:10:45 +00:00
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
print("Trigger is Active")
2025-02-25 02:10:45 +00:00
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func _on_body_entered(body: Node2D) -> void:
print("body collision in trigger")
areaTrigger.emit(effect, body)