Home > other >  Object of the current Rotation and turn 90 degrees around the Z axis fixed to the left or right afte
Object of the current Rotation and turn 90 degrees around the Z axis fixed to the left or right afte

Time:09-28

Click the button, the object slowly interpolation rotated ninety degrees to the left or right, during the button enabled=false; When rotate faster finish, determine the object rotation, button enabled=true; Rotation can continue to click on the object, the key is how the Angle between the two angles, and bosses give directions!

CodePudding user response:

Assumptions about object around Y axis rotation vector X axis and Z axis vector using Vector3. Dot by Dot product again Mathf. The radian multiplied by a cosine o Mathf. The Rad2Deg draw Angle

Mathf. A cosine (Vector3. Dot (X, Z)) * Mathf Rad2Deg don't know whether you mean it...
  • Related