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 Mat Brummitt · Jul 07, 2010 at 08:40 PM · rotationiphonejumpinglookatvalue

GameObject Rotation Jumps in value

Hi all,

In my app I have a rotating dial which allows the user to touch the indented "handle" and drag around it to move the dial in a clockwise / counter-clockwise direction. I am using a helper GameObject as my rotation object, and want to use the increasing or decreasing rotation value to adjust the BPM (beats per minute). Trouble is, when watching the helper's rotation value changing in the inspector, it appears to jump all over the place, rather than going from 0 - 359. The value seems to jump when the handle reaches the 12 o'clock and 6 o'clock position. The dial appears to work just fine visually, but the rotation value makes it impossible for me to use it as a way of judging an increment or a decrement of the main value.

Importantly, i'm using Transform.LookAt() to make the rotation helper look at where I am touching and dragging. Maybe there's a better way to go about this?

If anyone could advise me on this i'd be so grateful!

Thanks

Mat

Comment
Add comment · Show 1
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 qJake · Jul 07, 2010 at 09:44 PM 1
Share

You need to tell us exactly how you're getting the rotation values, otherwise we can't help you. Post some code (not all of it, just the relevant bits).

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by runevision · Jul 08, 2010 at 11:22 AM

In Unity rotations are stored as quaternions, which is a different representation than euler angles, even though euler angles is what is shown in the inspector. In the conversions between euler angles to quaternions and back, the numbers can change but the actual orientation remain the same. For example (0, 0, 370) could change to (0, 0, 10), which is identical rotations but with different representations.

If you want to have full control over the angles, you need to store the angle values yourself, for example in a Vector3, or in a flat if you only need to control one of them. You then manipulate these angle values and convert them when needed to quaternions, but you never read back from the quaternions. This way you will never get undesired changes in the angle representations.

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

No one has followed this question yet.

Related Questions

How Can I Stop Rotation From This Script? 0 Answers

smooth transform look at with space self rotation 0 Answers

Rotation with multiple objects 1 Answer

Make object only rotate in 90 degree increments 0 Answers

Bullet not moving towards player 3 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