Move a Rigidbody in a fixed joint without affecting the other

Hello,

I think this is a very common question but I do not find any answer.

I have a mass attached to another by a fixed joint.
The mass simulates a load cargo attached to a vehicle.

By design, It has to be possible to move the cargo. I have been trying to move it modifying the anchors, but it makes weird behaviours.

I have seen target position, but I not able to make it works. And I have tried to do it with JointDriveMode, but it says:

    //
    // Summary:
    //     ///
    //     The ConfigurableJoint attempts to attain position / velocity targets based on
    //     this flag.
    //     ///
    [Flags]
    [Obsolete("JointDriveMode is no longer supported")]

So, if JointDriveMode is obsolete, what it is the accepted/right way to move a rigibbody attached to another by a joint?

Regards

I answer my own question for other with the same problem.

Moving the anchors works fine, but you have to move the transform before:

        public void SetLocalPosition(Vector3 localPosition)
        {
            transform.localPosition = localPosition; //DO THIS
            joint.connectedAnchor = localPosition;
       }
2 Likes