if (lastFacing != currentFacing)
{
Quaternion setNavFacing;
Quaternion oldNavFacing = navPointer.transform.localRotation;
switch (currentFacing)
{
case Facing.North:
setNavFacing = new Quaternion(90f, 180f, 0f,oldNavFacing.w);
navPointer.transform.localRotation = setNavFacing;
break;
case Facing.South:
setNavFacing = new Quaternion(-90f, 360f, 0f, oldNavFacing.w);
navPointer.transform.localRotation = setNavFacing;
break;
case Facing.East:
setNavFacing = new Quaternion(0f, 280f, 90f, oldNavFacing.w);
navPointer.transform.localRotation = setNavFacing;
break;
case Facing.West:
setNavFacing = new Quaternion(0f, 90f, -90f, oldNavFacing.w);
navPointer.transform.localRotation = setNavFacing;
break;
}
lastFacing = currentFacing;
}
}
Simply put, I alter the local rotation of a plane which has the image of a pointer on it. The only value that ever changes in this code on the editor shows X and Z changine, Y never changes, on top of that, X and Z values never match what I am trying to set them too… Any pointers in what I have done wrong in this code would be greatly appreciated!