Search Unity

Rotation and Unity 3.1

Discussion in 'Editor & General Support' started by acmshar, Dec 2, 2010.

  1. acmshar

    acmshar

    Joined:
    May 4, 2010
    Posts:
    29
    Is there a change log with information about the changes in the rotation system for 3.1? I have a system using the Earth rotating and the moon revolving around the Earth. I check the current rotation of each object with GameObject.eulerAngles.y. With this update to 3.1 the coordinates seem to have changed from 0/360 being at 6 o' clock to being at 12 o' clock (or -1 to 1 respectively on a unit circle).

    I realize I am responsible for updating Unity in the middle of a project, but I can't seem to find any documentation about this change.
     
  2. Jesse Anders

    Jesse Anders

    Joined:
    Apr 5, 2008
    Posts:
    2,857
    I'll offer my usual response here, which is, don't rely on the Euler-angle representation of an object's orientation having any particular value. If there's something you need to do that needs to be angle-dependent, either drive it the other way (that is, store and manipulate the angles yourself and then simply assign them to the transform), or use some other method (e.g. based on vectors and/or relative angles).

    I don't know if anything changed in 3.1, but if for some reason the Euler-angle conversion code was modified in any way, it could certainly result in an apparent change in Euler-angle values.

    The particular change you describe though seems a little unlikely. Can you describe it in more detail? What does -1/1 on a unit circle mean?
     
  3. acmshar

    acmshar

    Joined:
    May 4, 2010
    Posts:
    29
    This was not a change in Unity. I made a mistake and replaced a Game Object (the one causing the moon to revolve was replaced with a camera when I was trying to test something) around the same time I upgraded to 3.1. I usually know better than to assume a bug/change is the fault of the software and not the user (me).

    Thanks, I'll look into storing the angles.

    This is what I meant by the unit circle, but it is clear you would have no idea what 1 and -1 would mean since I didn't give the corresponding axis (or other value).

    Apologies.