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
1
Question by EMOTION-THEORY · Nov 23, 2014 at 09:15 AM · c#transformquaternionrotateitween

transform.Rotate not working beyond 90 / 270 degs with RigidBodies (bug?)

I have a GameObject that is a Kinematic Rigidbody.

I'm trying to rotate this object (with iTween) on the X axis. IT WILL NOT ROTATE BEYOND 90 degrees.

It works when I remove the RigidBody but doesn't work with it on.

With the RigidBody NOT ATTACHED - it will automatically adjust the Y & Z values by 180 each - thus making it work just fine.

When the RigidBody IS ATTACHED it doesn't do this automatic adjustment and instead the X axis is clamped between 270 - 90.

This is both true when trying to adjust the value in the Inspector, as well as through code (using transform.Rotate).

This most certainly has to be a bug. Is there a workaround anybody knows of? Thanks.

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

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by Eric5h5 · Nov 23, 2014 at 06:53 PM

It's not a bug. Unity uses quaternions for rotation, and there's more than one valid way to convert a rotation to euler angles. For example, (0, 0, 0) and (180, 180, 180) are the same rotation. This is why the docs say not to use one axis from eulerAngles; you need to read the entire rotation. In the above example, if you read eulerAngles.x and saw it was 0, then read it again and it was 180, you might think it's "wrong", but it's not, in the context of the entire rotation.

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 EMOTION-THEORY · Nov 23, 2014 at 08:39 PM 0
Share

Thanks for your response.

I am using transform.Rotate to perform my rotations. When my eulerAngles read (90, 0, 0) or (270, 0, 0), transform.Rotate DOES NOT $$anonymous$$OVE THE$$anonymous$$.

The code is effectively rotating by small amounts every frame, like so:

 transform.Rotate ( new Vector3(1f, 0, 0), Space.World  ); // called every update.

this is just a summary of what the code is actually doing. I'm using iTweens RotateBy function.

I've gone digging deeper and found another interesting... thing. When your x values are at 90 or at 270, they seem to "snap" or "stick" to this value. Unless you rotate by an increment of about 3 or higher, it will remain stuck.

This seems to be the heart of the problem...! Is this a known issue? Any workarounds? Thanks.

avatar image
0

Answer by Jignesh G. · Nov 23, 2014 at 06:31 PM

Had you tried `transform.localEulerAngles? this might resolve your problem.

Thanks.

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

28 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

Related Questions

How i can equal 2 Tranform Rotations? 1 Answer

Quaternions acting up 1 Answer

Rotating a certain axis offsets the other ones? 1 Answer

if & Quaternion 2 Answers

How to always rotate clockwise 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