Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
2 captures
13 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
1
Question by 3dDude · Jun 12, 2010 at 03:00 PM · quaternionrotatecareulerangleswheels

eulerAngles + quaternion + car = help!?!

hi i am trying to make a car that runs on physics. what i have now is all the wheels have colliders and rigidbodys and hingeJoints to make them pivot. i am using rigidbody.AddRelativeTorque to make the wheel spin.

but what i am trying to do now it make the car steer. I dont know how to rotate objects using physics. so i am using the transform.eulerAngles or transform.rotation but. it does not seem to work.

Please Help!

Comment
Add comment · Show 1
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 Edy · Aug 16, 2010 at 11:01 PM 0
Share

Are you using WheelColliders?

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by Mike 3 · Jun 12, 2010 at 03:31 PM

You already had it - rigidbody.AddRelativeTorque on the car itself, around Vector3.up

Comment
Add comment · Show 2 · 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 3dDude · Jun 12, 2010 at 03:36 PM 0
Share

what i am trying to do is make the car run on physics so that the front wheels will turn left or right and the car will turn using physics

avatar image Mike 3 · Jun 12, 2010 at 04:01 PM 0
Share

I'm not sure how well the physics system will work that way. If you can get enough friction to drive your car forward from the torque, then rotating a parent object to each wheel may be the easiest way

avatar image
0

Answer by duck · Oct 16, 2010 at 07:44 AM

You should use wheelcolliders rather than attempting to implement wheels by spinning your own wheel-shaped rigidbody objects.

You don't turn or roll the WheelCollider object, they just stay fixed in a static position relative to the car. You apply torque to them and "Steer" them by adjusting values on the wheelcollider, and they will apply force to the car as appropriate.

One of the reasons for using this is that if you try to spin a regular wheel fast enough to make a car travel at high speed, the wheel might have to rotate more than a complete 360 turn each frame, which the physics engine cannot realistically simulate.

The wheel collider also simulates the dynamic and non-linear grip that a wheel provides, which is very difficult to simulate using a regular physics rigidbody.

Comment
Add comment · Show 2 · 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 3dDude · Oct 16, 2010 at 02:05 PM 0
Share

thanks duck! after the first few days of not using wheelcolliders i gave up :( lol thanks for answering tho!

avatar image duck ♦♦ · Oct 16, 2010 at 02:48 PM 0
Share

np. Incidentally, wheelcolliders also handle steering, you just pass the steering value to them, and they apply the correct forces to the car's rigidbody. This means you don't have to add torque to make your car body turn.

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

No one has followed this question yet.

Related Questions

When applying a 90 degree rotation to Euler Angles, it is over/undershooting sometimes.. 2 Answers

How to rotate an object around another 60 degrees with a keypress? 0 Answers

Rotate on X axies towards an objects height in 3D 1 Answer

Why is my rotation so weird? 1 Answer

Rotating a model with increments 1 Answer


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