extends Node class_name SceneControl @onready var path : Path2D = $DrawNode/TrackPath @onready var path_follow : PathFollow2D = $DrawNode/TrackPath/TrackFollower @onready var car : StaticBody2D = $Car func get_path_direction(pos): var offset = path.curve.get_closest_offset(pos) path_follow.progress = offset return path_follow.transform.x func get_path_next_position(pos): var offset = path.curve.get_closest_offset(pos) path_follow.progress = offset + 50 return path_follow.position func set_driving(driving: bool): car.driving = driving