Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

configurable joint free to bend but still not rigid in position?

Discussion in 'Scripting' started by vagos21, Aug 1, 2013.

  1. vagos21

    vagos21

    Joined:
    Sep 3, 2012
    Posts:
    18
    Hello,

    i've been trying for almost months to get this one right and it's driving me crazy! i've been working with configurable joints for more than a year but i have no idea why this doesn't work right...

    i'm doing a network of parts connected together by configurable "bendable" joints. i only want the joints to be able to bend (achieved) but stay in a rigid position (partially achieved)

    the settings i use for all joints are these:

    Code (csharp):
    1.                     CJ.xMotion = ConfigurableJointMotion.Locked;
    2.                     CJ.yMotion = ConfigurableJointMotion.Locked;
    3.                     CJ.zMotion = ConfigurableJointMotion.Locked;
    4.                     CJ.angularXMotion = ConfigurableJointMotion.Free;
    5.                     CJ.angularYMotion = ConfigurableJointMotion.Free;
    6.                     CJ.angularZMotion = ConfigurableJointMotion.Free;
    7.                     CJ.targetAngularVelocity = new Vector3(0.0,0.0,0.0);
    8.                     CJ.projectionMode = JointProjectionMode.PositionAndRotation;
    9.                     CJ.angularXDrive.mode = JointDriveMode.Position;
    10.                     CJ.angularYZDrive.mode = JointDriveMode.Position;
    11.                     CJ.rotationDriveMode = RotationDriveMode.XYAndZ;
    12.                     CJ.projectionDistance = 0.0;
    13.                     CJ.angularXDrive.positionSpring = 200.0;
    14.                     CJ.angularYZDrive.positionSpring = 200.0;
    The point is, if i create a chain of rigid bodies via configurable joints with these properties, they work just fine. their position is ok and they only bend. However, when i create a closed loop of them, some of the joints lose their positions!
    here's an example shot:


    and another one:


    i've tried all the following with no effect:
    • reducing timestep
    • increase solver iterations till up to 50
    • decrease the angular drive spring

    but nothing ever changes. i just want those joints to be able to bend...nothing more!
    can someone please help? i'm desparate with this PhysX i think it might be a limitation of it... :(