Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. We are looking for feedback on the experimental Unity Safe Mode which is aiming to help you resolve compilation errors faster during project startup.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Seeking Joint Expert

Discussion in 'Editor & General Support' started by Jerware, May 17, 2013.

  1. Jerware

    Jerware

    Joined:
    May 15, 2012
    Posts:
    41
    I've lost two days trying to figure this out. I have a simple torus (donut), and I want it to float, move and wobble in space but never to flip upside down. I've applied a configurable joint, and limited the X Z Angular motion like this:

    Low Angular XLimit
    Limit: -30
    Bounciness: 1
    Spring: 20
    Damper: .15

    High Angular XLimit
    Limit: 30
    Bounciness: 1
    Spring: 20
    Damper: .15

    Angular ZLimit
    Limit: 30
    Bounciness: 1
    Spring: 20
    Damper: .15

    Everything else is at their default settings, I believe. If I restrict the X or Z rotation on the rigidbody, the limit works fine for the other axis, but with all axes free the thing just freaks out as soon as it's affected by a force. It rotates beyond its limits and starts spinning like crazy.

    What am I doing wrong? The effect I'm trying to get is similar to a tire swing, but without the suspension chains. I just want the donut to lean in all directions, while spinning freely on the Y axis, but never lean past 90 degrees X or Z and flip over. Thanks for any help!
     
  2. Jerware

    Jerware

    Joined:
    May 15, 2012
    Posts:
    41
    Figured it out. In case anyone else barks up this tree, the solution was to assign Y as "Axis," and X as "Secondary Axis." Then don't assign Low and High Angular XLimits, but do assign identical Y+Z Angular Limits. You can also assign Rotational Drive Mode to "X YZ" and then enable Angular YZDrive to make the joint return to a pivot point (keep Angular XDrive disabled).

    I'm still somewhat confused as to why this worked, but there you go.
     
unityunity