Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question Configurable joint current torque doesn't reflect all constraints

Discussion in 'Physics' started by elijad, May 15, 2021.

  1. elijad


    Mar 19, 2020
    It seems that ConfigurableJoint.currentTorque doesn't include torque applied to solve for drive constraints aka target rotation. It only reports any values when joint is about to go out of rotation limits. Is there any info on how to calculate torque applied by drives manually?

    Here, current torque is shown as Colored vectors when joint's rotation constraints are set to locked. To counteract gravity and keep the body horizontal, the joint applies torque along X and Z axis.

    Here, rotation constraints are set to free and target rotation is set to match the direction of the white line. The joint is kept mostly horizontal by drives but no torque is reported.

    To summarize, here is a view of the inspector.


    Any info on how to calculate the actual drive torque would be appreciated.
  2. koirat


    Jul 7, 2012
    Probably not.
    I was fighting with ConfigurableJoint quite a lot also realized currentTorque is useless and generally how troublesome it is.
    You could try calculate torque applied when you got two bodies connected and there are no influences from the world like collisions. This could be done by reading positions and orientations every fixed frame and calculating changes.