Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 Jun 22
sparklines
Close Help
  • 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 BloodBTF · Aug 02, 2016 at 10:41 PM · speedcarwheelcollider

how to find out speed in MPH with wheelcollider.rpm

This might be a noob question, but im making a speed limiter and i want to do this through wheelcollider.rpm. the problem is, wheelcollider.rpm alone gives a value over 1000. I learned somewhere that you need to divide certain numbers to get the speed in mph, or kmh. The thing is, i dont kbow what numbers to divide by. If anyone could list the method to find this out, it would be alot of help

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

3 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by NordSpirit · Aug 02, 2016 at 11:41 PM

Hi @BloodBTF, if you wanna get you speed on mph or kmh, you should know circumference (L) of your will, to take it you should multiply the radius (R) of you wheel on 2 and PI. For example if radius (R) of your wheel is 1 meter then circumference (L) will L = 2*PI*R or 2*3.14*1 = 6.28 m . Now we know that your wheel is rotate by 1000 rpm. So every rpm you wheel is move on 6.28 m. If now we multiply 6.28 on 1000 we take 6280 meters on minute, or 6.2 km\m or 6.2*60 = 372 kmh. One mhile is 0.62 kilomiters so to convert kmh to mph just multiply 372*0.62=230 mph. So simply code on C# is will be:

 public void speedometer(){
         float wheelRadius; // put here your wheel radius
         int wheelRpm; // put here you rpm
         float circumFerence; //here we will store the circumFerence
         float speedOnKmh; // here the speed in kilometers in hour
         float speedOnMph; // and here the speed in mhiles in hour
 
         circumFerence = 2.0f * 3.14f * wheelRadius; // Finding circumFerence 2 Pi R
         speedOnKmh = (circumFerence * WheelRpm)*60; // finding kmh
         speedOnMph = speedOnKmh * 0.62f; // converting kmh to mph
     }

And don't forget that in Unity one unit is equl 1 meter, to work physics fine.

Comment
Add comment · Show 1 · 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 BloodBTF · Aug 02, 2016 at 11:58 PM 0
Share

thanks this was just what I was looking for

avatar image
0

Answer by diliupg · Jul 27, 2021 at 09:10 AM

(circumFerence * WheelRpm)*60 gives the answer in meters. Divide by 1000 to get Kmh. But this is not good to show in a speedometer or such cause the values fluctuate wildly! the best way is the get the rigidbody velocity. Do this.

  Speedometer.speed = (float)(ds.rb.velocity.magnitude * 3.6)
Comment
Add comment · Show 1 · 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 emilylena · Mar 31 at 12:39 PM 0
Share

No, that is NOT the best way, as that will give the velocity of the rigidbody REGARDLESS of whether it's connected to the ground and REGARDLESS of what direction you're traveling. If you're drifting the car will look like it's gaining speed even tho you're going sideways, which is in no way accurate to real life.

avatar image
0

Answer by ISTA33 · Sep 20, 2021 at 06:34 PM

Thank you So Mutch Guys it was Really helpfull

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.

Follow this Question

Answers Answers and Comments

54 People are following this question.

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

Related Questions

How to detect my car is drifting or not ? 1 Answer

Car is moving backword with Up Arrow Key [Solved] 1 Answer

WheelCollider Problem 1 Answer

Applying Torque to wheelcollider 1 Answer

How to make car AI using WheelColliders turn exactly 90 degrees? 0 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