In my Race Game, I am using a waypoint-based position tracking system. I am using an ordered list. Below is my code and it's working fine.
IOrderedEnumerable<KeyValuePair<string, Player>> sortedPlayer = players.OrderBy(x => x.Value.distanceToWaypoint).OrderByDescending(x => x.Value.activeWaypointIndex);
My problem is after the first lap it's acting wired. it's not working fine. means consider that the game has 10 waypoints. after the player passed 10 waypoints to the first way point its starts acting wired.
I have a lap counter script that counts how many laps passed correctly. is that any way to fix this problem using that lap count