My idea is to create a bar with some points, indicating the players/bots progression. So the points goes right/left depending on the player’s track progression. It’s hard to explain but I think it isn’t something super hard to do. I’ll make a small example down here
--------O----O-------|
O = plrs
| = finish line
I want those points to go more to right as the player progress in the race. No idea on how to do this. I was thinking of keeping track of the player’s position, but i’m not quite sure on how to implement that.
Edit: Reminding that I don’t want a full code since I wanna learn myself, I want an explanation or possible solution for what I want to do. Thanks.
I think i got a preview of what he is asking which is he wants a progress bar, u know like in mario cart they got a progress bar whenever u move to see how much more of a length u got to finish the race.
You could add regularly spaced Regions or Touch blocks along the length of your course which would detect the passing of each player. This would give you the progression as they traverse the course. Then it would be a simple case of updating the GUI location as they pass.
I was thinking of using this too. Might not be the best option, but using some kind of invisible parts to detect when a player passed a certain area to make the bar progress wouldn’t be that bad. Thanks.
The way this is normally done in games like Mario Kart is like this:
Put some invisible checkpoints on the course
Keep track of player’s most recently passed checkpoint with the Touched event
As a bonus, you can help prevent cheating by disallowing skipping checkpoints.
On each frame (use the Heartbeat event of RunService), figure out which section the player is on based on their most recent checkpoint. That section corresponds with one of the Rays from the previous step.
Use the Distance method of Ray to figure out how far along the player is in that particular section.
Sort the players first based on checkpoint, then based on distance along that checkpoint section.
I thought this question seemed familiar – here’s a model doing this exact thing I made five years ago lol. It probably still works, apparently there’s a README inside it that explains how to use it.