Speed Race Leaderboard

I am trying to make a speed race game mode for the next update for a game I work for and I’m having trouble figuring out how to detect who is ahead and behind you in the race so I can show what place you are in along with who is in the top 5 on this gui.

The race track isn’t straight which makes it hard for me to figure out how to this.
(White borders outline the track)

And here’s the finish line (Bottom left of last picture)

I’ve looked around dev forum and haven’t found anything that will help me with this.
Only thing I thought of but wouldn’t work out is putting parts around the track that when touched move you up a place on the leaderboard but that wouldn’t work if someone is touched the same part as you and hasn’t touched the next one.

If you have any idea how to achieve this plz tell me, and sorry if I didn’t explain it well.

You could try calculating the distance to the next turn, and then add that to the distance from that turn to the finish line. The concept may be explained better here: https://forum.unity.com/threads/how-to-create-race-positions-in-games.425469/

1 Like

I’ll try it out. Thanks for the tips.