- Home /
Is there a better way to do rotations with new Unity 2D?
I am pretty new to Unity but have worked with a few different game editors. I generally like working in 2D, and the new features are great but rotations seem a little wonky. Or maybe I am doing it wrong... these are the biggest problems I'm having:
1) The rotation vector for sprites in the inspector rotates counterclockwise for positive rotation values... seems weird.
2) Calculating rotations, for example when facing another object, requires using 3D functions and quaternions. This seems overly complicated. Quaternions are one of the main reasons I prefer 2D ;)
Is there a set of 2D functions to handle 2D rotations that I am not seeing?
Quaternions are as good for 2d as they are for 3d. You try to write the horrible interpolation functions you need for 2d euler angles. Also they aren't very hard to work with, once you know how they work it's quite easy to do everything.
You cna write your own converter which takes values in 2D and perform the action in 3D. The user only sees 2d though.
Answer by Vardan Meliksetyan · Feb 09, 2014 at 03:50 PM
Hi, at first can you say what gameobject you want to rotate, I have good experiance using 2D and 3D in other porject and needs we can do it different ways. After answering my question I can may be help you!
I am writing a bunch of components that I will use in my program$$anonymous$$g class for kids. I don't have a specific problem I need solved... just looking for more intuitive methods before I write them myself (as suggested in the comment from fafase on my question).
It's just so much easier to explain to a kid how to compare two floats (angles of rotation) than how to extract the rotation from a quaternion and then compare and then convert back in order to work with that angle.