What is happening in HingeJoint2D motors?

If you have two objects connected via a HingeJoint2D and enable the motor with a target speed of 0 and use the GetMotorTorque(float timeStep) function you will see a small value that decreases every time step. Okay maybe it’s converging towards zero.


Then if you give the motor a target speed, the torque value jumps up a bit but then continues to decrease every time step almost as if the motors are running out of battery? I doubt they have modelled batteries though as this wouldn’t make sense to include as a baseline.


Also, if I set the maximum force of the motor to say 10, the value obtained through GetMotorTorque() is usually much smaller (like 0.01) even when I use a large mass and high target speed.

I can’t find any documentation that explains what the values I’m getting are supposed to represent or how the motors in hinge joints work, please help!

It looks like I may have been using the GetMotorTorque() function incorrectly. I was putting in the current Time.fixedTime, really I should have been putting in the fixedDeltaTime. Sorted my problem anyway!