diff options
Diffstat (limited to 'Scripts/scene_control.gd')
-rw-r--r-- | Scripts/scene_control.gd | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Scripts/scene_control.gd b/Scripts/scene_control.gd new file mode 100644 index 0000000..9f231e0 --- /dev/null +++ b/Scripts/scene_control.gd @@ -0,0 +1,13 @@ +extends Node + +class_name SceneControl + +@onready var path : Path2D = $Path2D + +@on#ready 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 |