Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
1
Question by Totka · Oct 13, 2016 at 07:19 AM · modelwheelcollider

WheelCollider - Problem with model rotation

First of all I have to mention that I have just started to get familiar with Unity engine, so my question is probably really basic. :)

As my first task I would like to create simple car with simple controlling so I followed this tutorial on Unity's site: WheelCollider Tutorial

I could achieve to control my car but I stucked at adding a visual model to wheel collider. Here is my object hierarchy and how I set the models:

alt text

And this is the scene and game windows:

alt text

As you can see on the scene screen the wheels' rotation is fine but when I start the game it goes wrong. The wheels are turning and rotating but on a wrong way furthermore the car is not moving when I rotating the visual models. If I turn off the visual rotation the car is moving.

My assumption is I cannot rotate the wheels' model on scene because it will be rotated back according to the script: (I'm using the same code which is in the tutorial)

 collider.GetWorldPose(out position, out rotation);
      
 visualWheel.transform.position = position;
 visualWheel.transform.rotation = rotation;

So my questions:

  • How should I set the visual wheel models to display them correctly on scene and in game as well? And keep the car moving.

  • The tutorial gets first child transform and after that it gets again transform of visualWheel. Why it is necessary? Shouldn't we use only visualWheel?

unitiywheelcollider2.png (58.9 kB)
unitiywheelcollider2.png (395.0 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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by 40detectives · Jun 29, 2017 at 04:34 PM

Hi, I encountered the same problem as you.

  • For the first question I already posted a solution in the forums, here.

  • What you are doing in the tutorial script is saving a reference to the position an rotation of the visual wheel object first, and later, after the changes in the WheelCollider happen (that's why it's exec from the FixedUpdate), you update your visual wheel object with the collider's position and rotation.

Hope this helps.

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

78 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 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

Imported Models Not Rendering Correctly? 5 Answers

How to create a plot system 0 Answers

How do/should I make my character jump? 1 Answer

Is there any way to remove the seam in this character mesh? 0 Answers

Different 3d Model for different image targets. 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