Search Unity

Relaxing joints in script

Discussion in 'Physics' started by KillDashNine, Feb 16, 2021.

  1. KillDashNine

    KillDashNine

    Joined:
    Apr 19, 2020
    Posts:
    453
    Hiya,

    I have rigidbodies that are attached to each other with sometimes multiple ConfigurableJoints. I am trying to tweak the joint forces and torques to create a balance.

    I am changing the joint motions and angularmotions from Locked to Free in script and am finding that this doesn't actually change the forces and torques. The values change to Free and I can see it in the Editor, just it has no effect on the forces.

    I have tried extensively, waking up Rigidbodies, making FixedUpdate waits between the changes, changing first to Limited then to Free, having FixedUpdate waits in between. So far I have found nothing that will at least consistently produce the expected result.

    The only thing I have found that actually will change the forces is changing the ConfigurableJoint motion and angularmotion values manually in Editor. This seems like a bug why it doesn't work from script.

    Any ideas appreciated.