Need help with Unity Racing Game

Hello everyone,

I am currently in the process of building a racing game. I have the Player's car movement down to a basic version and I am now trying to figure out how to create opponents for the players to compete with.

The most common solution to this via google searching and tutorial videos is ray casting and determining how far the car is from the edge of the track so that it doesn't turn the wrong way, however, that in itself is quite complex and I am struggling to understand it.

Has anyone got any tips or am I doing the wrong thing to create opponents?



Seems to me that you should take a look at Navigation System : Unity - Manual: Navigation System in Unity (
It should allow you to set up areas NavMesh where your opponents NavMesh Agent will move towards a destination.
(NOTE : I've never used it, so I'm just sharing my thoughts here)

Thank you so much for the help.

I had a look at the Navigation system as recommended and it looks perfect for what I need. It seems you can create areas for navigation which allow the AI opponents to go down the correct routes, take short cuts and avoid each other/obstacles at the same time.

Thanks again for the help!

1 Like