Rigidbody.drag 阻力

var drag : float

Description描述

The drag of the object.

物体的阻力。

Drag can be used to slow down an object. The higher the drag the more the object slows down.

阻力可用来减缓物体的速度。阻力越高物体减慢越快。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	void OpenParachute() {
		rigidbody.drag = 20;
	}
	void Update() {
	if (Input.GetButton("Space"))
		OpenParachute();

	}
}
function OpenParachute() {
	rigidbody.drag = 20;
}

function Update() {
	if (Input.GetButton ("Space")) {
		OpenParachute();
	}
}
Page last updated: 2011-1-29