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

スクリプト言語

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

Rigidbody.MoveRotation

Switch to Manual
public function MoveRotation(rot: Quaternion): void;

Description

Rigidbodyオブジェクトを指定する角度へ回転します

For kinematic rigidbodies it applies friction based on the motion of the rigidbody. This lets you simulate moving / rotating platforms with rigidbodies sitting on top of the elevator. If you want other rigidbodies to interact with the kinematic rigidbody you need to move it in the FixedUpdate function.

	var eulerAngleVelocity : Vector3 = Vector3 (0, 100, 0);
	function FixedUpdate () {
		var deltaRotation : Quaternion = Quaternion.Euler(eulerAngleVelocity * Time.deltaTime);
		rigidbody.MoveRotation(rigidbody.rotation * deltaRotation);
	}