Need proper help for my click-racer like game

You can write your topic however you want, but you need to answer these questions:

  1. I already achieved it but I can’t reverse it like yk, I want to make it go forward instead of backwards

  2. Here is the issue https://gyazo.com/a4d94fa74d885d0bce1af26fa7525281

  3. I have tried like multiplying/dividing or making it negative, nothing works, I don’t know how to reverse it’s direction

local position = UDim2.new(humanoidrootpart.Position.Z/5000, 0, 0.952, 0)

That is the code I’m using, But for some reason the UI goes backwards when I’m going the right way

UPDATE: I fixed the direction but it isn’t sensitive then it becomes really sensitive
example: https://gyazo.com/19350e8f31869823d5007aa35e105689
heres my code:

local position = UDim2.new(0.2 + 1.2/vhrp.Position.Z, 0, 0.952, 0)
local ratioTraveled = <distance traveled> / <total distance>

position = UDim2.new(ratioTraveled + .2 ,0 , 0.952,0)

so if the course is 1000 studs

ratioTraveled = vhrp.Position.Z/1000

something like that.