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