现在的位置: 首页 > 综合 > 正文

Rigidbody.AddForce 添加力

2013年05月11日 ⁄ 综合 ⁄ 共 213字 ⁄ 字号 评论关闭

添加一个力到刚体。作为结果刚体将开始移动。

// Adds a force upwards in the global coordinate system
//在全局坐标系统添加一个向上的力

function FixedUpdate () {
	rigidbody.AddForce (Vector3.up * 10);	
	//rigidbody.AddForce (0, 10, 0);

}

如果你想在多帧中应用力,你应该在FixedUpdate中而不是Update使用使用它。

抱歉!评论已关闭.