I am trying to rotate a game object 90 degrees about the global axis but can only seem to make it rotate about it’s local axis.
I am calculating rotation like this and then slerping it after:
if (direction == directions.right)
{
newRotation = transform.rotation * Quaternion.Euler(0,-90,0);
}
else if (direction == directions.left)
{
newRotation = transform.rotation * Quaternion.Euler(0, 90, 0);
}
else if (direction == directions.up)
{
newRotation = transform.rotation * Quaternion.Euler(90, 0, 0);
}
else if (direction == directions.down)
{
newRotation = transform.rotation * Quaternion.Euler(-90, 0, 0);
}
Cheers!