aboutsummaryrefslogtreecommitdiffstats
path: root/Scripts/scene_control.gd
blob: 9f231e01eee28b7756cba21a8ee4d7bdbfd60be6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
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