• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Bhasker reddy · Jul 16, 2012 at 06:34 PM · positioncar

Car's position indicator or Standings .

Hello, My friend and i started making a racing game from past Week,But we got a problem about showing position of the car on gui.

This Photo gives you more Idea what i was asking about marked with green color :D

Help me please thank you :D and have a good day :D

need-for-speed-the-run-4e41bc7d87d98.jpg (76.6 kB)
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Meltdown · Jul 16, 2012 at 06:49 PM

There are several ways to approach this..

  1. Create a set of waypoints around the track. With each waypoint having a progress value. In your Update() method you can keep checking which waypoint is closest to each car. The car closest to the most further waypoints on the track, that has the most laps is the leader. But this method is not always accurate, especially if you have tight corners or tracks where a waypoint on another part of the track may be closer to a car than the closest waypoint to him on his part of the track.

  2. Create a set of box colliders around your track (very tedious job), each time your car collides with the box, use the box's name to determine how far the player's progress is on the track. So you can call them box1, box2 etc. This is the most accurate method I can think of.

Comment
Add comment · Show 7 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Bhasker reddy · Jul 16, 2012 at 07:06 PM 0
Share

Any example Script on 2 option please :D thank you very much

avatar image Meltdown · Jul 16, 2012 at 07:10 PM 0
Share

It's pretty easy to figure out. As each collider gets touched, just get its name, then replace box out the name to get the numeric value. If there are 200 colliders in the scene.. for each lap the player has done, add 200 to the total.

avatar image Bhasker reddy · Jul 16, 2012 at 07:34 PM 0
Share

You totally misunderstood Sir,what i was actually asking is car [player] position i mean if they are 4 opponent cars when the race start ...i would like to show where the player position in between the opponents i mean like 1/4 if player was first in the game or like 4/4 if player was last.... to avoid confusion i posted the photo :D hope you help me Sir :D

avatar image Meltdown · Jul 16, 2012 at 07:41 PM 0
Share

I understood exactly what you are saying and that is exactly what my solution proposes. You base car position on the total value of colliders passed + (number of laps * colliders per lap).

avatar image Bhasker reddy · Jul 16, 2012 at 07:52 PM 0
Share

How should i deter$$anonymous$$e Aicar sir?? let's assume that player was at 4/3 ["4" is the opponents and "3" is the player position in race ],if player get passed away from Aicar How should i deter$$anonymous$$e it like 4/2.. beside am just 13 year's old..difficulty in understanding these things .... so if you get solution please be more specific so that i can understand totally Sir :D....

Show more comments
avatar image
0

Answer by kapyar · Feb 09, 2016 at 05:14 PM

Hey, you could try my plugin which can handle all math. Its really simple to use you must add only 2 prefabs to your scene https://www.assetstore.unity3d.com/en/#!/content/45698

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Race checkpoint system small help please :) 1 Answer

Dose any one know how to send object current postion to preivues posistion 1 Answer

Freeze Position problem 1 Answer

How to set current position to previous postion 1 Answer

position indicator for car in racing game ? 4 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges