Unity - Scripting API - Transform - Rotate
Unity - Scripting API - Transform - Rotate
Rotate
[Link]
Search scripting...
TextGenerator
TextMesh
Texture
Manual [Link]
Scripting API
Leave feedback
Texture2D
Version: 2020.3 C#
Texture2DArray SWITCH TO MANUAL
Texture3D
Time
Description
Touch
Use [Link] to rotate GameObjects in a
TouchScreenKeyboard
variety of ways. The rotation is often provided as
TrailRenderer an Euler angle and not a Quaternion.
Transform
You can specify a rotation in world axes or local
Tree
axes.
TreeInstance
TreePrototype World axis rotation uses the coordinate system of
UICharInfo the Scene , so when you start rotate a GameObject,
its x, y, and z axes are aligned with the x, y, and z
UILineInfo
world axes. So if you rotate a cube in world space,
UIVertex its axes align with the world. When you select a
Vector2 cube in the Unity Editor’s Scene view, rotation
Vector2Int Gizmos appear for the left/right, up/down and
forward/back rotation axes. Moving these Gizmos
Vector3
rotates the cube around the axes. If you de-select
Vector3Int and then re-select the cube, the axes restart in
Vector4 world alignment.
WaitForEndOfFrame
Local rotation uses the coordinate system of the
WaitForFixedUpdate
GameObject itself. So, a newly created cube uses
WaitForSeconds its x, y, and z axis set to zero rotation. Rotating the
cube updates the rotation axes. If you de-select
and the re-select the cube, the axes are shown in
the same orientation as before.
[Link] 1/7
30/8/2021 Unity - Scripting API: [Link]
[Link]
Search scripting...
TextGenerator
TextMesh Manual Scripting API
Texture
Texture2D
Version: 2020.3 C#
A cube rotated in Local Gizmo Toggle
Texture2DArray
Texture3D
Time
Touch
TouchScreenKeyboard
TrailRenderer
Transform
Tree
TreeInstance A cube not rotated in Global Gizmo Toggle
TreePrototype
UICharInfo
UILineInfo
UIVertex
Vector2
Vector2Int
Vector3
Vector3Int
A cube rotated in Global Gizmo Toggle
Vector4
WaitForEndOfFrame
WaitForFixedUpdate For more information on Rotation in Unity, see
WaitForSeconds Rotation and Orientation in Unity.
Declaration
public void Rotate(Vector3 eulers,
Space relativeTo
= [Link]);
Parameters
eulers The rotation to apply in euler
angles.
[Link] 2/7
30/8/2021 Unity - Scripting API: [Link]
Description
The implementation of this method applies a
rotation of zAngle degrees around the z axis,
xAngle degrees around the x axis, and yAngle
degrees around the y axis (in that order).
Touch
TouchScreenKeyboard // [Link] example
TrailRenderer //
UILineInfo
private GameObject cube1, cube2;
UIVertex
Vector2 void Awake()
Vector2Int {
cube1 = [Link]
Vector3
[Link] = n
Vector3Int
[Link](90.0f
Vector4 [Link]<Renderer>
WaitForEndOfFrame [Link] = "Self";
WaitForFixedUpdate
cube2 = [Link]
WaitForSeconds
[Link] = n
[Link](90.0f
[Link]<Renderer>
[Link] = "World";
void Update()
[Link](xAngl
[Link](xAngl
}
[Link] 4/7
30/8/2021 Unity - Scripting API: [Link]
[Link]
Declaration
Search scripting... public void Rotate(Vector3 axis,
float angle,
Space
TextGenerator relativeTo = [Link]);
Description
Applies a rotation of eulerAngles.z degrees around
the z-axis, eulerAngles.x degrees around the x-axis,
and eulerAngles.y degrees around the y-axis (in
that order).
Declaration
[Link] 5/7
30/8/2021 Unity - Scripting API: [Link]
Search scripting...
TextGenerator
Parameters
TextMesh Manual xAngle
ScriptingDegrees
API to rotate the GameObject
Texture around the X axis.
Texture2D
Version: 2020.3 yAngle Degrees to rotate the GameObject C#
Texture2DArray around the Y axis.
WaitForSeconds
Description
Rotates the object around the given axis by the
number of degrees defined by the given angle.
[Link] 6/7
30/8/2021 Unity - Scripting API: [Link]
Search scripting...
TextGenerator
TextMesh Manual Scripting API
Texture
Texture2D
Version: 2020.3 Is something described here not working as you expect it to?C#
It
Texture2DArray
might be a Known Issue. Please check with the Issue Tracker
Texture3D
Time at [Link] .
Touch
TouchScreenKeyboard Copyright ©2021 Unity Technologies. Publication Date:
TrailRenderer
Transform 2021-08-23.
Tree
Tutorials
Community Answers
Knowledge
TreeInstance
TreePrototype Base
Forums
Asset Store
UICharInfo
UILineInfo
UIVertex
Vector2
Vector2Int
Vector3
Vector3Int
Vector4
WaitForEndOfFrame
WaitForFixedUpdate
WaitForSeconds
[Link] 7/7