relativeTo | 回転はオブジェクトに対してローカルか、ワールド |
eulers | 適用する回転 |
Z 軸で eulerAngles.z
度回転、X 軸で eulerAngles.x
度回転、Y 軸で eulerAngles.y
度回転します (順番は説明した順)
If relativeTo
is not specified or set to Space.Self the rotation is applied around the transform's local axes.
If relativeTo
is set to Space.World the rotation is applied around the world x, y, z axes.
using UnityEngine;
public class ExampleClass : MonoBehaviour { void Update() { // Rotate the object around its local X axis at 1 degree per second transform.Rotate(Vector3.right * Time.deltaTime);
// ...also rotate around the World's Y axis transform.Rotate(Vector3.up * Time.deltaTime, Space.World); } }
xAngle | X 軸の周りで回転する角度 |
yAngle | Y 軸の周りで回転する角度 |
zAngle | Z 軸の周りで回転する角度 |
relativeTo | 回転はオブジェクトに対してローカルか、ワールド |
Z 軸で zAngle 度回転、X 軸で xAngle 度回転、Y 軸で yAngle 度回転します (順番は説明した順)
If relativeTo
is not specified or set to Space.Self the rotation is applied around the transform's local axes.
If relativeTo
is set to Space.World the rotation is applied around the world x, y, z axes.
using UnityEngine;
public class ExampleClass : MonoBehaviour { void Update() { // Rotate the object around its local X axis at 1 degree per second transform.Rotate(Time.deltaTime, 0, 0);
// ...also rotate around the World's Y axis transform.Rotate(0, Time.deltaTime, 0, Space.World); } }
axis | 回転を適用する軸 |
angle | 適用する回転角度 |
relativeTo | 回転はオブジェクトに対してローカルか、ワールド |
axis 軸の周りに angle 度、回転します。
If relativeTo
is not specified or set to Space.Self the rotation is applied around the transform's local axes.
If relativeTo
is set to Space.World the rotation is applied around the world x, y, z axes.
using UnityEngine;
public class ExampleClass : MonoBehaviour { void Update() { // Rotate the object around its local X axis at 1 degree per second transform.Rotate(Vector3.right, Time.deltaTime);
// ...also rotate around the World's Y axis transform.Rotate(Vector3.up, Time.deltaTime, Space.World); } }