How to modify the Rotation value of unity

How to modify the Rotation value of unity


Rotation modification of transform

transform.Rotation cannot directly = new Vector3(0,0,0) like position and scale

You can use:
transform.localRotation.eulerAngles to get the angle
transform.localRotation = Quaternoin.Euler(new Vector3(0,0,0)) and modify it
. Note that the range of Euler angles is: 0-180 -180 - 0

Guess you like

Origin blog.csdn.net/lucky_XiaoZhang/article/details/127927421