• 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 /
This question was closed Jul 27, 2014 at 03:45 AM by SteelArrow21 for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by SteelArrow21 · Jul 27, 2014 at 03:00 AM · rotationtransformquaternionnumberx

Rotation Numbers Are Off?

So I didn't know how to word the title, but for some reason, my script thinks transform.localRotation.x is completely different from what my hierarchy thinks. For example, I did a simple debug:

 Debug.Log(transform.localRotation.x);

This is in my Update function so it is called every frame. While testing the game, my hierarchy said the transform's x rotation was 270°. Well thanks to my debug, I could see that my script thought it was at -0.7062691°. Has anyone had the same problem, or am I just doing something completely stupid? If anyone can help me understand this, thank you. If not, thank you.

Comment
Add comment · Show 2
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 27, 2014 at 03:09 AM 0
Share

localRotation is a Quaternion with values between -1 and 1. Try transform.eulerAngles.

avatar image SteelArrow21 · Jul 27, 2014 at 03:25 AM 0
Share

Yep, you're right. It was a stupid mistake. If you change your comment to an answer, I'll mark it right.

0 Replies

  • Sort: 

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

23 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

Related Questions

Instantiate GameObject towards player 0 Answers

Random.rotationUniform clarification 4 Answers

Transform a Vector by a Quaternion 1 Answer

player rotation to follow the mouse 2 Answers

Rotation issue with remote players projectiles 0 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges