4 Replies - 2608 Views - Last Post: 02 March 2013 - 08:43 AM Rate Topic: -----

#1 tntcenturion  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 17-March 12

[Unity3D] How to make Race Standings or Position ?

Posted 28 February 2013 - 06:12 AM

Hello everybody, I'm making a racing game project. I have a question on making Race Standings or Position. You know, it's like this

Posted Image

I've searched all around google and it still doesn't help. I've also tried all my method to make this thing works.

I've tried
  • Who is nearest to the Waypoint, itís the lead. But it was failed, because i canít figure it out how to make the player knows its ranking.
  • Activate when a player hits a triggered box collider and then check if the player which is just hit the line is in front of me, the player rank was +1, and otherwise if the player which is just hit the line is in my behind, i was +1. But i donít use it because all player thinks they are number 1.
  • Use Vector3.Dot to check the distance to other player. Not used because of complexity.
  • Who is fastest to the waypoint its the lead. Itís record time you reached the checkpoint and compare it to other. The Reason i donít want to use this because, i canít figure it out how to make the player knows its ranking.
  • Each AI Shoots ray to waypoint. AI Distance value send to all waypoint. Then Waypoint sort the distance. From AI kart, find a distance that has same value with waypointer, and then the waypointer returns it length.
  • Use SphereCollider Is Trigger to check distance. But the AI doesn't work properly when i do this.


Do you know a method that works to make a race standings ? please help me. This code making me crazy.

Thanks for any help

Is This A Good Question/Topic? 0
  • +

Replies To: [Unity3D] How to make Race Standings or Position ?

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 8943
  • View blog
  • Posts: 33,536
  • Joined: 12-June 08

Re: [Unity3D] How to make Race Standings or Position ?

Posted 28 February 2013 - 08:12 AM

It should be as simple as figure out, for each racer, how many laps have occurred and that racer's distance to the finish line. Order that data by laps finished and the distance..
Was This Post Helpful? 0
  • +
  • -

#3 anonymous26  Icon User is offline

  • D.I.C Lover

Reputation: 0
  • View blog
  • Posts: 3,638
  • Joined: 26-November 10

Re: [Unity3D] How to make Race Standings or Position ?

Posted 28 February 2013 - 08:23 AM

Well, you have a start/finish line right? The more times this line is crossed the more laps have been completed. Now comes the problem of determining who is ahead on a track where the shape of the track can take any form.

How I would approach this problem is to have a marker of some kind, visualize a tape measure running along the center of a track for its entire length. Each car model will have some kind of reference point on its front bumper from which is position on the track can be sampled, so we end up with some kind of functionality that resembles:

carPos = getPos(car.LapCount, car.LapProgression);



See what I mean? It will work for every car on the track - even those that are lapped.
Was This Post Helpful? 1
  • +
  • -

#4 tntcenturion  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 17-March 12

Re: [Unity3D] How to make Race Standings or Position ?

Posted 02 March 2013 - 08:16 AM

View PostButchDean, on 28 February 2013 - 08:23 AM, said:

Well, you have a start/finish line right? The more times this line is crossed the more laps have been completed. Now comes the problem of determining who is ahead on a track where the shape of the track can take any form.

How I would approach this problem is to have a marker of some kind, visualize a tape measure running along the center of a track for its entire length. Each car model will have some kind of reference point on its front bumper from which is position on the track can be sampled, so we end up with some kind of functionality that resembles:

carPos = getPos(car.LapCount, car.LapProgression);



See what I mean? It will work for every car on the track - even those that are lapped.


Okay thanks! I think i solve it! I just have to make a new script that have currentRank. That script also have distance to waypoint. To know the current rank, i set distance to waypoint = waypoint.playerDistance and then sort it for who's nearest to the checkpoint. But i think it's kinda buggy a bit
thanks a lot!
Was This Post Helpful? 0
  • +
  • -

#5 anonymous26  Icon User is offline

  • D.I.C Lover

Reputation: 0
  • View blog
  • Posts: 3,638
  • Joined: 26-November 10

Re: [Unity3D] How to make Race Standings or Position ?

Posted 02 March 2013 - 08:43 AM

You'll work it out. :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1