Unity5 刚体添加力


教程都是Unity4.x的  5版本不适用


public var thrust: float;
public var rb: Rigidbody;
function Start() {
	rb = GetComponent.<Rigidbody>();
}
function FixedUpdate() {
if(Input.GetMouseButtonDown(0))
	rb.AddForce(transform.up * thrust);
}


猜你喜欢

转载自blog.csdn.net/qq_36718838/article/details/72638421
今日推荐