diff options
author | IcECreAm777 <hgk.1998@googlemail.com> | 2023-07-08 01:52:33 +0200 |
---|---|---|
committer | IcECreAm777 <hgk.1998@googlemail.com> | 2023-07-08 01:52:33 +0200 |
commit | 88e3751834af72c413afa25a7c17a5994f570bfb (patch) | |
tree | bba4a22c9cd22507fd381306f42866301e21f72f /Scripts/scene_control.gd | |
parent | 2fc6727848748e5fd3957bda69179d1c261b02a0 (diff) | |
download | 2023-88e3751834af72c413afa25a7c17a5994f570bfb.tar.gz 2023-88e3751834af72c413afa25a7c17a5994f570bfb.tar.bz2 2023-88e3751834af72c413afa25a7c17a5994f570bfb.zip |
end of day commit
Diffstat (limited to '')
-rw-r--r-- | Scripts/scene_control.gd | 12 |
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 |