So im working on a driving/racing game and i seem to be stuck at the racing part, because i have a basic idea of how to make a racing system with checkpoints and stuff but its not reliable and it wouldnt
work as well as it should. So my idea was to make the player go into a highlighted circle which will modify a value inside of the player which will determine if the player is in a ‘queue’ or not and when the player joins a value/folder/model is created in a folder with the name of the player with a position attached, and there would be an Int Value that determines how many players are in the queue and another one for the maximum amount of the players, and when the current players value becomes equal or higher than the max value it will teleport the players to the starting positions, but here is where i run into a serious problem, the fact that i dont quite know how to make the players not leave the race, maybe i could use collision groups and then add invisible parts that they cant go through? im not quite sure if this would work, and how would i keep track of the player`s position in the race? ray casting maybe? would that work? im not the best at this but i would really want to make this system work since my players request this the most and i seem to be stuck down at really specific issues i listed above. So whats the best way for me to go about making this?
What I’ve seen be the general method is to have multiple checkpoints around the track which will provide you the basic position of players and be the method to ensure racers aren’t corner cutting. Then, you track the distance each player is to their next checkpoint to get the fine tuned positioning of where they are in the race.
well i can make an Int Value for each player that increases when you hit a checkpoint and then check if your value is higher than the other values thus putting you in first place but this would still only work reliably with 2 or 3 players max, but im trying to make this possible up to 8 players or more, or am i thinking about this the wrong way?
There is more behind it than just checkpoints. You over looked using the distance to the next checkpoint to determine who is in the lead.
that is true, but how do i calculate that?