Created
July 3, 2016 23:17
-
-
Save Kayli/4c465ebc8fa636b42015dec58dcd3655 to your computer and use it in GitHub Desktop.
2 equivalent methods of adding torque
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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