Auto turning on bends in race game?

Hi I’m new to unity/game making and I need a little push in the right direction.

I’m trying to make a racing game, but I want the game to focus more on tactics, then the actual driving. I want to game to turn bends on the track automatically. I want it so that if the car is on an X point in the road and hits a corner, it will take that corner and stay at the same X point as it’s going around.

I have looked into A.I. Pathfinding but from what I can tell, it would start to pull the car into the corner and not stay at the same point.

Temple Run 2 is a good example with the way it follows the curved paths automatically (not the 90 degree turns).

Does anyone know what function I need to look into to get this to work? Or any tutorials that have this feature in?

Any help will be appreciated.

Thanks

You can look into Tweens, you can make let’s say 3 tweens across your racing environment and when a car is switching lanes it actually switches which tween it follows and you can set the speed on which the car is moving along the tween and so on.

Put a trigger box on corners. Auto generate a spline (run time or offline) that travels through and exits that corner.
See Tweens as said above

Thanks for the reply guys.

I’m sorry but I didn’t explain myself that well. I’m finding it hard whether to use technical words to describe it.

I still want to be able to move left and right while in the turn and not on a fixed amount of lanes. Could I just change the Tween dynamically through the turn to match where the car wants to be on the road or would that be to taxing for systems? The game is intended for Mobiles and Tablets.

Thanks

Then make a single tween and use an offset for each car, which is controlled by the player so that the car will still follow that tween but based on that offset it’ll be more to the right or more to the left. and that way you’ll have an infinite number of possibilities (because of the float offset :slight_smile: ) and the turning will feel smooth.

Thanks ever so much ar0nax. I was trying to look into skewing the Tween with the car, but an offset sounds much better on resources!

Thanks again!