Search Unity

Question Moving a connected rigidbody using ConfigurableJoint's connected anchor?

Discussion in 'Physics' started by markuskir, Dec 5, 2022.

  1. markuskir

    markuskir

    Joined:
    Mar 2, 2018
    Posts:
    11
    Hey, checking to make sure that this is possible and to see if anybody has advice. Help is highly appreciated!

    I have a rigidbody connected to another using a configurable joint. What I want to do is move the connected rigidbody to a new position and rotation relative to the main body while maintaining the joint connection... it seems like it should be possible using the connectedAnchor and Axis properties, but every time I try, the objects go flying.

    Pic attached, B is connected to A via a ConfigurableJoint, I want to move B to TAR.
    1137498-007df996e9b151eda32ac471ffc5b71e.png

    The motivation for this is moving objects to precise locations using forces rather than transform.position. For instance, I want to move a jar containing physics objects into the character's hand, into an exact pose, while maintaining collisions between the jar and objects inside it. It should also continue to collide with physics objects along the way. If alternative approaches come to mind, please share!