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

スクリプト言語

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

Transform.forward

Switch to Manual
public var forward: Vector3;

Description

ワールド空間のTransformの青軸

	// Set's the rigidbody velocity to be 
	// along the blue axis of the transform

	rigidbody.velocity = transform.forward * 10;

他の例:

	// Computes the angle between the target transform and this object
	var angleBetween = 0.0;
	var target : Transform;
	function Update () {
		var targetDir = target.position - transform.position;
		angleBetween = Vector3.Angle (transform.forward, targetDir);
	}