summaryrefslogtreecommitdiffstats
path: root/Trigger.gd
diff options
context:
space:
mode:
Diffstat (limited to 'Trigger.gd')
-rw-r--r--Trigger.gd12
1 files changed, 12 insertions, 0 deletions
diff --git a/Trigger.gd b/Trigger.gd
new file mode 100644
index 0000000..b8bc471
--- /dev/null
+++ b/Trigger.gd
@@ -0,0 +1,12 @@
+extends Spatial
+
+signal entered
+signal exited
+
+func _on_Inside_body_exited(body:Node):
+ if $Outside.overlaps_body(body):
+ emit_signal("exited")
+
+func _on_Outside_body_exited(body:Node):
+ if $Inside.overlaps_body(body):
+ emit_signal("entered")