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

スクリプト言語

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

Rigidbody.angularVelocity

Switch to Manual
public var angularVelocity: Vector3;

Description

Rigidbodyの角速度ベクトル

In most cases you should not modify it directly, as this can result in unrealistic behaviour.

	// Change the material depending on the speed of rotation
	var fastWheelMaterial : Material;
	var slowWheelMaterial : Material;
	function Update () {
		if (rigidbody.angularVelocity.magnitude < 5) {
			renderer.sharedMaterial = slowWheelMaterial;
		}	
		else {
			renderer.sharedMaterial = fastWheelMaterial;	
		}
	}