言語: 日本語
  • C#
  • JS
  • Boo

スクリプト言語

お好みのスクリプト言語を選択すると、サンプルコードがその言語で表示されます。

Transform.localEulerAngles

Switch to Manual
public var localEulerAngles: Vector3;

Description

親のTransformオブジェクトから見た相対的なオイラー角としての回転値

x,y,zの角度は、z軸にz度、x軸にx度、y軸にy度の順に回転します。 この変数は読み込んだり、絶対値の角度を設定する時のみ使用してください。角度が360度を超えた時には失敗するのでインクリメントしないようにしてください。 代わりにTransform.Rotateを使用してください。

	// Print the rotation around the parent's X Axis
	print (transform.localEulerAngles.x);
	// Print the rotation around the parent's Y Axis
	print (transform.localEulerAngles.y);
	// Print the rotation around the parent's Z Axis
	print (transform.localEulerAngles.z);

Unityは自動的にTransform.localRotationに格納されている回転から角度を変換します。