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 zafadadynamic · Jul 17, 2014 at 11:18 AM · androidrotationrotateeulerangleseuler

Rotation on Android vs. PC

So here's my problem. All of my calculations are correct, but I have a problem with using rotation like this:

 transform.rotation = Quaternion.AngleAxis(CalculatedCurrentAngle, Vector3.up);
 

The above always seems to flip the axis on Android, but works fine on PC. It only flips it when I begin to apply a rotation. After that, it will just kind of flip back and forth for some reason.

These lines have the same effect. Mind you they both work find on PC.

 transform.localRotation = Quaternion.Euler(0.0, CalculatedCurrentAngle, 0.0);

It's imperative that I be able to set the exact value. Torque works and doesn't present any kind of problem except for the fact that I can't rotate the object with physics to an exact position without using some sort of 'snapping'. I know it's not the calculations considering I have all of the variables visible and I continuously monitor them. Also, it works fine on PC as I said earlier.

Here's everything I tried:

     } else if (Switch == true) {
         
         if (SecondPoint != PreviousPoint) {
         
             if (SecondPoint < PreviousPoint) {
             
                 //transform.rotation = Quaternion.AngleAxis(CalculatedCurrentAngle, Vector3.up);
             
                 //rigidbody.constantForce.torque = Torque;
                 
                 //transform.Rotate(0, StandardRotationSpeed, 0);
                 
                 transform.localRotation = Quaternion.Euler(0.0, CalculatedCurrentAngle, 0.0);
                 
             } else if (SecondPoint > PreviousPoint) {
             
                 //transform.rotation = Quaternion.AngleAxis(CalculatedCurrentAngle, Vector3.up);
             
                 //rigidbody.constantForce.torque = -Torque;
             
                 //transform.Rotate(0, -StandardRotationSpeed, 0);
                 
                 transform.localRotation = Quaternion.Euler(0.0, CalculatedCurrentAngle, 0.0);            
             } else {
             
             
             }
         }
     }

Thanks, everyone. All of you have always been a great help.

Comment
Add comment · Show 3
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 robertbu · Jul 17, 2014 at 02:47 PM 1
Share

Are you talking about physical changes to the objects, or are you talking about changes in what you read by when you read eulerAngles? If it is the latter, then you are out of luck and will have to come up with an alternate method of dealing with whatever you are trying to do with eulerAngles. 'eulerAngles' are derived from the rotation (Quaternion). There are multiple different eulerAngle representations for any given physical rotation.

avatar image zafadadynamic · Jul 17, 2014 at 05:36 PM 0
Share

It's basically a swipeable rotating menu. I think what I'll do is create a video showing everyone the exact problem. It's probably the only real way I can explain it.

avatar image zafadadynamic · Jul 17, 2014 at 10:11 PM 0
Share

Well, I basically took the easy way out. I just used another game object to drag the menu's rotation. Lame. I would still love to know how I can get perfect rotation on mobile though. This is the thing that ruined another project I was working on.

Anyway, if y'all experience the same problem and find a solution, let me know. I'll post more about this later when I get the time. I went to make a vid, but apparently before I went to sleep last night I broke it even more lol

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

2 People are following this question.

avatar image avatar image

Related Questions

Camera rotation behaving strangely 2 Answers

How to properly reference a Euler? 1 Answer

Trouble Spawning Bullets with proper rotation 0 Answers

Object makes random jumps in rotation 1 Answer

How can I store the individual values of EulerAngles on a Database then re-apply 2 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