aboutsummaryrefslogtreecommitdiffstats
path: root/Scripts/scene_control.gd
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--Scripts/scene_control.gd12
1 files changed, 12 insertions, 0 deletions
diff --git a/Scripts/scene_control.gd b/Scripts/scene_control.gd
new file mode 100644
index 0000000..99bc3a2
--- /dev/null
+++ b/Scripts/scene_control.gd
@@ -0,0 +1,12 @@
+extends Node
+
+class_name SceneControl
+
+@onready var path : Path2D = $Path2D
+@onready var path_follow : PathFollow2D = $Path2D/PathFollow2D
+
+
+func get_path_direction(pos):
+ var offset = path.curve.get_closest_offset(pos)
+ path_follow.h_offset = offset
+ return path_follow.transform.x