Change the position of car based on some condition

If I have this first position is 0,0,0 and second position is -648, 18, -151
is it possible to make it work like calculate distance between car and road
and based on it make the car little upper or lower when it reaches bump
or raycasting way?

the first pos is road
the second pos is car

I dont see how to make it work because the car drives on y=18

but generally the road changes in y because I see some bumps (like up and down)
or some path following like follow the changing y coord on accelerate?

Hey! Its better to work using colliders on the road bumps but if you can’t do it by that then you can set car position relative to the road position.
If you are getting the road position on each update called then you can set the car position by adding the y axis of road. By adding, car will go up/down on the basis of the road y axis.

1 Like