Download

Win condition for local multiplayer racing game

Having trouble finding a way to end the game, how can we determine the player that wins the game first? there are 3 laps and 4 checkpoints to a lap

Hi LDodds,

You can have a trigger box over your starting line that, when hit, ticks up by 1. This box would register the value to each specific vehicle. Once it hits 3 (final +1, or what would have been the start of the fourth lap if you went to 4), have the trigger box run a series of branches checked each cars variable to see which hit the trigger box first, second, third, etc. To check the values after the first player crosses the finish line trigger box, you can check the other vehicle’s distance to the trigger box along a spline, setting the closest vehicles as second and so on, or allow them to continue racing until the last person crosses the finish line. There are a number of other methods you could use and experimenting is the best way to find what works for your game. Admittedly I have not tried this myself, but hopefully it gives you a starting point to move forward and figure out what will work for your project!