Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 bobo72a · Sep 25, 2013 at 06:58 AM · torquecar-tutorial

Car Tutorial Alt Physics Torque Steering

Hey,

I've been playing around with the Alt Physics model in the Unity Car tutorial and I really like it so far, but I'm having a problem with front wheel drive cars.

When the car is set to rear wheel drive, I don't get any random veering, which is good, but when I set the two powered wheels to the front, I get these random torque differences between them while driving on flat surfaces, which causes the vehicle to veer in one direction or the other. I've looked it up and it's called Torque Steering (http://en.wikipedia.org/wiki/Torque_steering), and there's a solution implemented already. It seems to follow the formula for a LSD (http://en.wikipedia.org/wiki/Limited-slip_differential). However, I think it's programmed strangely, or at least impossible to calibrate. Here is the official solution:

             float drivetrainFraction = 1.0f/poweredWheels.Length;
             float averageAngularVelo = 0;    
             foreach(Wheel w in poweredWheels)
                 averageAngularVelo += w.angularVelocity * drivetrainFraction;
 
             // Apply torque to wheels
             foreach(Wheel w in poweredWheels)
             {
                 float lockingTorque = (averageAngularVelo - w.angularVelocity) * differentialLockCoefficient;
                 w.drivetrainInertia = inertia * drivetrainFraction;
                 w.driveFrictionTorque = engineFrictionTorque * Mathf.Abs(ratio) * drivetrainFraction;
                 w.driveTorque = engineTorque * ratio * drivetrainFraction + lockingTorque;
 
                 slipRatio += w.slipRatio * drivetrainFraction;
             }
             
             // update engine angular velo
             engineAngularVelo = averageAngularVelo * ratio;

I've gotten as far as recognizing that we should multiply in the square of the radius of the wheel to convert angular velocity to torque:

             float lockingTorque = (averageAngularVelo - w.angularVelocity) * w.radius * w.radius * differentialLockCoefficient;


...but other than that, I'm stumped, and don't really know how to calculate the correct coefficient. There has to be a better solution out there to correct for this in FWD cars. Does anybody have it?

Comment
Add comment · Show 3
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 Fattie · Sep 25, 2013 at 07:06 AM 0
Share

For any cars at all. I would just use Edy's vehicle physics. Why waste months developing something that already totally exists you know?

avatar image bobo72a · Sep 25, 2013 at 07:36 AM 0
Share

I don't really have the money to spend at the moment.

Besides, for some of us, getting there is half the fun ;)

avatar image Fattie · Sep 25, 2013 at 08:00 AM 0
Share

"Besides, for some of us, getting there is half the fun ;)"

I appreciate you're just joking, but it's not really in that category.

I'd look for and use one of the free car rigs around.

0 Replies

· Add your reply
  • Sort: 

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

16 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

Related Questions

How to rotate An object around another axis using Torque? 2 Answers

Trying to apply a force on a ball at certain angles but the ball moves back and forth or otherwise moves erratically 1 Answer

Can I emulate simple space-like gravity? 2 Answers

How to accurately transfer torque? 0 Answers

Apply force and torque on different collider enter 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