Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

how to get angle rotated with mag. and sign (direction)??

Discussion in 'Scripting' started by sarthakz9, Jun 10, 2015.

  1. sarthakz9

    sarthakz9

    Joined:
    Jun 3, 2015
    Posts:
    19
    Quaternion.Angle(target.rotation,initil_rotation) is returning the angle rotated but without sign ... Wether i go clickwise or anti... Its just giving +ve value

    How can i get angle with sign.
     
  2. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,200
    There's thousands of hits on this on the googles. Like this one.
     
  3. sarthakz9

    sarthakz9

    Joined:
    Jun 3, 2015
    Posts:
    19
    Nopes... Its not my case...
    In my case...
    I want when my spherical object rotates (along y ) camera has to rotate around it so that it always shows ,sphere back side....

    I think i have to use ... Transform.rotatearound ..
     
  4. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,200
    You don't have to end every sentence with elipses. Commas and single periods are allowed.

    If you want a camera to rotate with a sphere, just set it as that sphere's child.
     
    sarthakz9 likes this.
  5. sarthakz9

    sarthakz9

    Joined:
    Jun 3, 2015
    Posts:
    19
    Hey,
    Is there anyway to know the absolute angle of rotation.
    I.e between 0-360?