Search Unity

Comparing rotations

Discussion in 'Scripting' started by tetriser016, Jan 7, 2014.

  1. tetriser016

    tetriser016

    Joined:
    Jan 3, 2014
    Posts:
    100
    Hi,

    This is my first thread on Unity Forum.

    I want to know how to compare rotations in an object?
     
  2. gfoot

    gfoot

    Joined:
    Jan 5, 2011
    Posts:
    550
    What kind of comparison do you want to make?
     
  3. Kona

    Kona

    Joined:
    Oct 13, 2010
    Posts:
    208
    I suppose you want to compare if the rotations match, if so you can do it by using Quaternion.Angle with rotation A and rotation B as arguments and then make an if-block to check if the angle is less than a specific threshold.
     
    Avidgeek likes this.