Search Unity

  1. Unity 2019.4 has been released.
    Dismiss Notice
  2. 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
  3. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

[Solved] Troubleshooting Joint Behavior in Ragdoll

Discussion in 'Physics' started by hausrath, Jan 17, 2018.

  1. hausrath


    Sep 30, 2016
    Hi All,

    I'm researching what could be causing some vibrating/separating joints, as seen here:

    I'm using "Move Towards" to adjust the position of the Player object, expecting the shoulder/arm/elbow/forearm object joints to ragdoll with it. Here's what I've got for solutions:

    From this forum post
    • Using “move towards” to move the player object towards the mouse position, instead of adding force or impulse to it in that direction
      • This would happen because the rigid bodies are trying to hit the colliders, but move towards is telling them to ignore that and keep moving.
    • Could it be caused by the frequency or damping settings?

    From this forum post, the problem could be related to how my anchors are set.

    From this forum post, I could try to add a distance joint between the first segment (player) and the last arm segment. This kind of seems like a solution to a different problem, though, so I’m not sure it would apply.

    Finally, this forum has some interesting ideas, namely to work with joint Projection and Solver Iteration Count within the joints.

    Actually, one more - and shout out to the "Similar Topics" below the "Create Post" here: This page in the manual may just have answered my question, but I’ll post anyway in case others are having a similar issue. It recommends many things:
    • Disabling Preprocessing within the joints. It specifically says do this to “prevent joints from separating or moving erratically.”
    • Enabling Projection and Solver Iterations.
    • Avoid scaling (which I definitely did not do in the project)
    • Transform with Rigidbody2D.MovePosition
    • Advises against overlapping rigidbodies
    I was going to ask for your advice, but I'll go ahead and try a few things first, then I'll come back and update if additional questions come up, or if I find a solution.

  2. hippocoder


    Digital Ape Moderator

    Apr 11, 2010
    @MelvMay is the resident expert on all things 2D physics (and more) might know if he is not too busy!
  3. hausrath


    Sep 30, 2016
    Thanks very much, hippocoder. I appreciate the reference!

    I went through the manual and the first thing I adjusted made a huge difference. I moved the rigidbodies away from each other slightly, so that they were no longer overlapping on spawn. Boom. Problem solved. Looks like it was just a newbie mistake this time.

    I'm getting some strange behavior related to mass (I think) on a couple objects, but my guess is that it's related to scaling, as I drastically scaled some of the stock assets to bust out a quick prototype.

    Thanks again for your quick response. Looking forward to moving forward with the project.
    MelvMay likes this.