I am stumped while trying to set the z-axis of the local rotation of a cube to zero. I cant use Rotate, because I dont know what the rotation on the z is going to be, so I wouldn’t know how much to add or subtract to get to zero. Also, Unity docs says that localEulerAngles will set to the rotation of the parent and my gameObject does not have a parent transform. Why is it that the Unity Engine does not provide a simple solution for such a basic function? I have looked at the docs for each rotation function and cant find anything that is specific to true local rotation.
I’m sure I can store the current local rotation in a var and then do a subtraction on something, but not sure how to.
Thanks James. I have tried that, but it still rotates the transform based on global rotation. My understanding was that for a transform without a parent, the world becomes the parent? Is that incorrect?