Transform. Rotate Rotation
Apply the Rotation Angle of an ouarla angle. The eulerangles. Z degree is centered around the Z axis, the eulerangles. x degree is centered around the X axis, and the eulerangles. y degree is centered around the Y axis (in this Order ).
If the rotation angle is left blank or set to space. self, it is applied to its own axis around the transformation. (X, Y, and Z axes are displayed when an object is selected in the scenario view.) If the rotation angle relative to space. World is applied to the X, Y, and Z axes around the world.
1Gameobject. Transform. Rotate (NewVector3 (0,1,0), Input. getaxis ("Horizontal"); // Indicates to press the left and right keys to rotate around the Y axis. The rotation method is as follows:
It can be seen that there is a certain distance between the rotation center and the rotating orbit. Just like the Earth's revolution around the sun.
Transform. rotatearound rotates around
Rotate an object by angle through the point axis in the world coordinates.
Simply put, an object is rotated at a certain position in the world coordinate based on its degree.
Gameobject. Transform. rotatearound (NewVector3 (0,0,0),NewVector3 (0,1.0f,0), Speed * time. deltatime * input. getaxis ("Horizontal"); // Indicates that the left and right moving keys are pressed, and the object rotates around the Y axis at the specified point. The rotation method is as follows:
Just like the autobiography of the Earth.