Sorry for yet another quaternion question. basically i want to know if there are 2 quaternion values that are the same, like an opposite. I am using RotateTowards and then an if to check whether it has finished rotating. The problem is that printing the angle that its supposed to end at is different than my actual angle, even though rotateTowards seems to have finished. here are the prints that i get:
Expected Angle : (0.0,0.9,0.0,-0.4)
After RotateTowards : (0.0,-0.9,0.0,0.4)
the If statement is never getting true since some of the values are inverted but they still seem to be correct.
how can i make this work? or is there a better way to check for when Rotate Towards is finished?
here is some of my code:
weaponBarrel.transform.rotation = Quaternion.RotateTowards(weaponBarrel.transform.rotation,barrelRot,barrelRotateSpeed*Time.deltaTime);
if(weaponBarrel.transform.rotation==barrelRot){
fire=true;
}
see how barrelRot is in the if statement and the rotateTowards statement…