Skip to content

Instantly share code, notes, and snippets.

@Kayli
Created July 3, 2016 23:17
Show Gist options
  • Save Kayli/4c465ebc8fa636b42015dec58dcd3655 to your computer and use it in GitHub Desktop.
Save Kayli/4c465ebc8fa636b42015dec58dcd3655 to your computer and use it in GitHub Desktop.
2 equivalent methods of adding torque
const float torque = 50f;
//apply torque using joint motor
_hingeJoint1.motor = new JointMotor { freeSpin = true, force = torque, targetVelocity = 999999f };
_hingeJoint1.useMotor = true;
//apply torque using "add torque" method
_cube3Rigidbody.AddTorque(0, 0, torque);
_cube4Rigidbody.AddTorque(0, 0, -torque);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment