How in race game Identify the Race Leader

Hi.

I do race location in my game. I use Level Sequence to create path for every NPC car move. I need identify which cars leaders, position in race. Is there some ready blueprint solution?

You can assign all of the racers numbers on start, and switch their numbers when one passes the other.

Now the question becomes “How to detect when one car ‘passess’ another car?” How do we define “passing”? You can do it by placing a spline in your level that covers the entire track, and when two cars get close enough to each other, switch the cars’s assigned numbers if the car with the lower value’s closest location on the spline is further into the spline than the one with the higher value. I don’t remember the calculation method exactly from memory, but this is how you can do it :blush:

1 Like

Thank a lot, I will try understand and reproduce