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 RolfBertram-com · Apr 17, 2011 at 03:07 PM · rotationcarwheel

Make the rotation of a tire physically move a car

I want to create a "real" rubber tire that rotates and thereby moves the car physically. It's a slow car, no racing, and I want it totally realistic for certain functions in the game. It seems that making the wheel rotate is only visual. It does not move the car. The car is Rigidbody, and the wheel is attached, has wheelcollider. I'm using itween to smoothly rotate the tire with sineInAndOut. Rotation looks good, but car does not move.

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

4 Replies

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

Answer by Statement · Apr 17, 2011 at 03:43 PM

You need to make use of rigidbody.ApplyTorque and make sure that the physics material on the tires aren't slippery. Further, you need to bind the wheels to the chassis using joints. You probably need to make some sort of suspension joint to allow the car to travel on rough terrain, or it'll be too stiff and bounce around.

Comment
Add comment · Show 4 · 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 Statement · Apr 17, 2011 at 03:45 PM 0
Share

You could also apply the motion through the motor on the hinge joint I guess.

avatar image RolfBertram-com · Apr 17, 2011 at 04:10 PM 0
Share

Works! Thanks!!! However, the wheel does not spin visually. The car moves, the wheel must obviously spin. But the wheel graphics don't spin.

avatar image Statement · Apr 17, 2011 at 06:00 PM 0
Share

You need to parent the wheel graphic to the wheel.

avatar image RolfBertram-com · Apr 17, 2011 at 09:06 PM 0
Share

Got it! This needs to be attached to the graphics, and linked to the WheelCollider: CorrespondingCollider : WheelCollider; function Update () { //transform.rotation = CorrespondingCollider.rotation Quaternion.Euler( RotationValue, CorrespondingCollider.steerAngle, 0 ); transform.Rotate(Vector3.right CorrespondingCollider.rpm ( 360/60 ) Time.deltaTime);}

avatar image
0

Answer by Jason B · Apr 17, 2011 at 03:41 PM

You may want to check out this car tutorial provided by Unity.

Personally, I've mucked around with wheel colliders for days and still never got anything better than a slippery car that has trouble cornering and tips over no matter how heavy and low to the ground its mass is, so I'm inclined to believe that wheel colliders perform mediocre at best, but that would just be my own personal analysis.

You're right that rotating the wheel doesn't rotate the car. In actuality, you need to change the WheelCollider.steerAngle in order to steer and WheelCollider.motorTorque to spin the tires.

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
avatar image
0

Answer by Jean-Fabre · Apr 17, 2011 at 04:01 PM

Hi,

You can also use a configurable joint and use that joint to turn the wheel. It works very well, but not as good as a wheel collider.

Bye,

Jean

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
avatar image
0

Answer by Kurius · Sep 19, 2017 at 06:19 PM

Remove all colliders from your car, except for WheelCollider. Most common mistake is to put colliders on your tires, even though you are already using WheelColliders. In this case the colliders will conflict with each other, and even though your tires will be spinning, your car won't move.

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

2 People are following this question.

avatar image avatar image

Related Questions

Car Front Tires rotation clamped between 270° - 90° 0 Answers

Vehicle engine RPM without wheelcolliders? 1 Answer

Rotation math question: car movement on a cylinder 0 Answers

rotate the camera in the z axis 1 Answer

Help with ramdom and rotation on a car 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