Hey guys, I am currently working on a racing game and am thinking about the following system on a race track:
A series of triggers with increasing numbers either in their name or in a script attached. This would help me to achieve following goals:
- Use the position and numbering of triggers to navigate AI cars [like a path]
- Calculate the position of each car depending on the current number of passed colliders
- If the car falls off the track, I can use the last known trigger number - 5 to respawn the car
Those are all convex plane colliders set up as triggers. Now my first question: There is a maximum of 7 cars on the track which would have trigger checks throughout the whole time. Is this a good approach?
And the more difficult question: This system works fine for single way racetracks. But my tracks will have branches and maybe even branches inside branches. I think I can find a way to achieve AI navigation and respawning, but how would I reliably calculate the current position?
I’m thankful for every idea you guys have