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 Azaroth · Nov 08, 2013 at 02:31 PM · rotation

Object Rotation doesnt work

Hello, so i have a body and according to the wasd i want to rotate front-left-right-back. Front-Back works, but left right not. And generaly i have problems with the rotation in unity...

Comment
Add comment · Show 9
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 Ejlersen · Nov 08, 2013 at 06:34 PM 0
Share

Could you show us your code?

avatar image Starwalker · Nov 08, 2013 at 06:58 PM 0
Share

you must be rotating Quaternion values, use EulerAngles.

avatar image clunk47 · Nov 08, 2013 at 07:21 PM 0
Share

Please reword the question, it doesn't really make sense. Just be a bit more detailed and post the code you're currently using, and this will be able to be answered pretty quickly by the community :D

avatar image Huacanacha · Nov 09, 2013 at 06:41 AM 1
Share

So what exactly is working and what isn't? And what exactly do you expect each bit of code to do?

Your problem is probably related to using Quaternion components directly... these don't relate to rotations as we humans understand them. Try using Quaternion.Euler ins$$anonymous$$d:

 skeleton.transform.localRotation = new Quaternion.Euler(90,0,0);  // 90 degrees forward/down
 skeleton.transform.localRotation = new Quaternion.Euler(-90,0,0);  // 90 degrees backwards/up
 skeleton.transform.localRotation = new Quaternion.Euler(0,90,0);  // 90 degrees left
 skeleton.transform.localRotation = new Quaternion.Euler(0,-90,0);  // 90 degrees right

Also, are you trying to set an absolute rotation or add change the existing rotation? Currently you are overwriting which will ignore the current rotational state.

avatar image Starwalker · Nov 09, 2013 at 10:02 AM 1
Share

Quaternion.lerp and .slerp are for smoothing of angles in quaternion.

Show more comments

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

19 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

Related Questions

Why are these shapes deforming? 1 Answer

Top Down 3D moves in unexpected ways. 1 Answer

Animation problem with rotation and position. 0 Answers

Camera Limit Rotations Problem 1 Answer

Rotation Problem 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