ForceMode:
Force:关注的是力整体
Impulse:关注的是冲量,与质量相关
VelocityChange:关注的是速度,与质量无关
Acceleration:关注的是加速度,与质量无关
public void AddForce(Vector3 force, [Internal.DefaultValue("ForceMode.Force")] ForceMode mode);
扭矩:AddTorque(ForceMode同上)
public void AddTorque(Vector3 torque, [Internal.DefaultValue("ForceMode.Force")] ForceMode mode);
如:
public class AddForceTest : MonoBehaviour
{
private Rigidbody rd;
// Start is called before the first frame update
void Start()
{
//rd.AddForce(new Vector3(0,0,10),ForceMode.Force);
//rd.AddForce(new Vector3(0,0,10),ForceMode.Acceleration);
rd.AddTorque(Vector3.forward);
}
}