- Home /
How to make one game object follow another?
I'm making a game where you are in a car and other cars can follow your car. If I use a simple script where the car faces your car and just moves forward, that car will go through buildings and stuff and not follow the road. How can I make it so the car follows your car without going off the road?
Try approaching this in terms of Unity game concepts - how does your game know what a "road" is and how might you prevent it from leaving that?
Answer by ardizzle · Feb 11, 2014 at 02:27 AM
I would experiment with an idea to where you car every X amount of seconds, I would start small like .5 seconds, drops a way point behind it. And rather than the AI car following your car it follows that way point. And if you have another car following that car just make the second car drop way points. Just make sure they destroy the way points after reaching them.
Your answer
![](https://koobas.hobune.stream/wayback/20220613133138im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Use OpenCV with in-game camera to detect road lanes 0 Answers
Getting Camera to Stop Following Player 1 Answer
Horizontal axis not working after animation 1 Answer
how to make an ai car follow player car 1 Answer
Camera follow Avatar 1 Answer