- Home /
How do i make another car in my car game to drive and chase around my track?
I have made a car game and i only have a car that is drivable but in racing games like nfs most wanted how do they make a car that will chase and drive around with us in the race track?
help me with this please
You need to create some AI that controls the other cars. Try searching around for examples if you don't know how where to start. Really simply put, you just need to figure out how to tell the other cars where to go and how to do it. Well, at last in this case.
For example, you know how to control 1 car in the game by using the keyboard. Now you just need to figure out code that replaces the buttons that you press with code.
A rather simple example would be to use the same code that you already have and create another script/class that would take care of driving the AI car. For example, by placing emptyGame objects around the track as wayPoints which the car has to follow / drive towards.