• 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 VDTruck · Feb 24, 2013 at 09:06 PM · z axis

Steering wheel roll in wrong direction

Help me please! I'm working at a trucking game and I have a problem. In my game, when I press left or right button, the steering whell will be rotate on z axis. All great, but my 3d model of steering wheel is not rotating right.

Also, the moving and rotating axe is not right... What can I do?

Check out this: http://vdtruck.net/store/volan.png

Thanks, and sorry for my bad english.

Comment
Add comment · Show 4
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 nsxdavid · Feb 24, 2013 at 09:13 PM 0
Share

Not enough information to really help in detail (no code shown, etc.). But check that your code is rotating the localEulerAngles.z angle of the transform of the steering wheel. You might be modifying the eulerAngles property by mistakes, which is in world space.

avatar image VDTruck · Feb 24, 2013 at 09:19 PM 0
Share

The code is correct. It modify just z axis. The problem is with the 3d model of steering wheel.

avatar image nsxdavid · Feb 24, 2013 at 09:23 PM 0
Share

Again, depends on which z component you are talking about. Like I said. Other than that, make sure your model is correct. Would be helpful to show the code snippet plus a screen shot that shows your steering wheel selected in the scene view with the transform gizmo (in local not global), plus the inspector.

avatar image VDTruck · Feb 24, 2013 at 09:32 PM 0
Share

Check out this: http://www.youtube.com/watch?v=$$anonymous$$v9XGIy7QVs&feature=youtu.be The steering wheel from demo car is ok, but my s.wheel not.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by robertbu · Feb 24, 2013 at 09:34 PM

As @nsxdavid suggested, the coordinates of the model likely don't match Unity coordinates. You can "fix" this problem using an empty game object. Place the empty game object at the center of the steering wheel with the orientation you want (i.e. if you want to rotate around z, then make z the axis of your steering point with the empty game object). Make the steering wheel object a child of the empty game object. Then put the steering script on the empty game object. It may take script fixes as well. Post the script here if the empty game object does not fix the problem.

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 nsxdavid · Feb 25, 2013 at 01:07 AM 0
Share

Yeah, unfortunately the video doesn't show enough detail to clearly see what's going on. But it appears the steeringwheel is not modeled such that Z is straight through the intended axis of rotation. So @robertu's approach is the in-Unity fix for that.. otherwise just fix the model.

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

10 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

Related Questions

How to setup a 2D Beat em up? 1 Answer

Lock Rotation of Object between 2 points, which is looking at the direction the mouse is pointing 0 Answers

How do I limit my car's z rotation when a key is pressed? 0 Answers

Only Lerp 2 coordinates 0 Answers

How to make blender bones z axis forward in Unity 4 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