GodotCourse/examples/PlatformTemplate/scripts/areatrigger.gd

21 lines
323 B
GDScript3
Raw Permalink Normal View History

2024-07-15 12:00:42 +00:00
extends Area2D
@export var effect = "alert"
signal areatrigger(effect, Object)
func _on_area_entered(area):
print("area entered")
func _on_area_exited(area):
print("area exited")
func _on_body_entered(body):
print("body entered")
areatrigger.emit(effect, body)
func _on_body_exited(body):
print("body exited")