Legacy Documentation: Version 2018.2 (Go to current version)
LanguageEnglish
  • C#

Rigidbody2D.AddTorque

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Switch to Manual
public void AddTorque(float torque, ForceMode2D mode = ForceMode2D.Force);

Parameters

torqueTorque to apply.
modeThe force mode to use.

Description

Apply a torque at the rigidbody's centre of mass.

A torque is conceptually a force being applied at the end of an imaginary lever, with the fulcrum at the centre of mass. A torque of five units could thus be equivalent to a force of five units pushing on the end of a lever one unit long, or a force of one unit on a lever five units long. Unity's units are arbitrary but the principle that torque = force x lever length still applies.

Note that unlike a 3D Rigidbody, a Rigidbody2D can only rotate in one axis and so torque is a float value rather than a vector.

See Also: AddForce, AddForceAtPosition, Rigidbody.AddTorque.

对文档有任何疑问,请移步至开发者社区提问,我们将尽快为您解答