| eulerAngles | 適用する回転 |
| relativeTo | 回転はオブジェクトに対してローカルか、ワールド |
Z 軸で eulerAngles.z 度回転、X 軸で eulerAngles.x 度回転、Y 軸で eulerAngles.y 度回転します (順番は説明した順)
relativeTo が指定されていない場合や Space.Self の場合、回転は Transform のローカル軸に適用されます。
relativeTo が Space.World の場合、回転はワールドの X、Y、Z 軸で適用されます。
using UnityEngine;
public class ExampleClass : MonoBehaviour { void Update() { // Rotate the object around its local Y 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 度回転します (順番は説明した順)
relativeTo が指定されていない場合や Space.Self の場合、回転は Transform のローカル軸に適用されます。
relativeTo が Space.World の場合、回転はワールドの X、Y、Z 軸で適用されます。
using UnityEngine;
public class ExampleClass : MonoBehaviour { void Update() { // Rotate the object around its local Y 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 度、回転します。
relativeTo が指定されていない場合や Space.Self の場合、回転は Transform のローカル軸に適用されます。
relativeTo が Space.World の場合、回転はワールドの X、Y、Z 軸で適用されます。
using UnityEngine;
public class ExampleClass : MonoBehaviour { void Update() { // Rotate the object around its local Y 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); } }