0
\$\begingroup\$

In UNITY game development platform while programming in C# I came across a method to add torque to component: public void AddTorque(float x, float y, float z, ForceMode mode = ForceMode.Force); In this Function what is meant by ForceMode?

\$\endgroup\$
2
\$\begingroup\$

ForceMode is an enumeration. It has 4 values,

ForceMode.Acceleration = Constant change not affected by mass

ForceMode.Force = Constant change which is affected by mass

ForceMode.Impulse = Instant change which is affected by mass

ForceMode.VelocityChange = Instant change which is not affected by mass

For more details, watch the Official Unity tutorial for AddForce. https://www.youtube.com/watch?v=MBDWTjn05eg

\$\endgroup\$
  • \$\begingroup\$ @hkishnani3 this is correct, documentation: ForceMode \$\endgroup\$ – Theraot Jun 27 at 16:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy