I am learning how to use unity and just had a quick question about the best practice when altering certain aspects of rotation. If I only wanted to adjust the x and z aspects of a new rotation what would be the best way to do it.
I came up with either:
newRotation.x = 0F;
newRotation.z = 0F;
Or:
newRotation = new Quaternion(0f, newRotation.y, 0f, newRotation.w);
Which of these would be the better way to go about accomplishing the task of zeroing out x and z but leaving the rest the same? Or is there another way that I am missing?
Thanks