What I'm really looking for is to get from vector3 to euler angles.
I was thinking of converting a vector3 to a quaternion, and then using the eulerAngles method in the quaternion.
I want to be able to tell how many degrees away from Up the iphone's accelerometer is along a single axis.
Answer by Peter G
Apr 10, 2010 at 11:48 PM
I think you want to use Quaternion.LookRotation() to create a rotation facing that Vector then measure the angle of the new quaternion.
I could have sworn I tried that... Thanks!
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
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.
Answers and Comments
No one has followed this question yet.
3D nested Turret Prefab Rotation
C# Array with random.range help?
LookRotation and Raycasting
I keep getting: No appropriate version of 'UnityEngine.Object.Instantiate' for the argument list '(float, UnityEngine.Vector3, UnityEngine.Quaternion)' was found.
How do I make create a rotateable object that follows a raycast hit point?