AI car doesnt wanna follow line correctly

ok i am very much getting desperate with this thing

  1. What do you want to achieve?
    A: im trying to get my cars to follow a “racing line” made of parts around a racing track.

  2. What is the issue?
    A: although the script works fine and all, i think the problem is on the car itself.

External Media

basically after some time that the car has been following the line, it starts waving around from side to side in the line trying to correct its trajectory so it stays within the line, but this causes it to wave around too much due to speed to the point where it wrecks. (no idea if i made sense, english isnt my primary language)

  1. What solutions have you tried so far?
    A: i tried initially changing the setup of the car so it was tighter, but that didnt really work and it kept waving around after some time

heres a snippet of code from the ai script:

	if closestPoint then
		local difference = closestPoint.CFrame:PointToObjectSpace(LineFollower.CFrame.Position)
		local steer = difference.X

		if steer ~= nil then
			seat.Throttle = 1
			if difference.X > 1 then
				seat.Steer = -1
			elseif difference.X < -1 then
				seat.Steer = 1
			else
				seat.Steer = 0
			end
		else
			seat.Throttle = 0
			seat.Steer = 0
		end
	end

(“closestpoint” is the closest part to the car, which is found on a pairs inside the same loop of this script)
edit: ok i had no idea streamable links needed to be downloaded my bad

Where’s the dot product? That’s required for steering.

well i use the normal roblox vehicle seat with only the steer values, so i dont really need that so the steering can work

and i think the problem is on the car itself but the script is the one who controls it, so i would think that the way the steering gets changed is simply too basic for an “ai” car to properly work