Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question Chain/Rope, but locked at both ends?

Discussion in 'Physics' started by dgoyette, Apr 6, 2021.

  1. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,205
    I've had some pretty good results making chain/rope using ConfigurableJoints with a rigged model:

    upload_2021-4-6_17-24-24.png

    This works very well when one end is locked (fixed joint to a kinematic body), and the other end is not. However, I would also like to be able to lock the other end of the rope. It seems, however, that this only results in very unstable behavior.

    Given a chain of ConfigurableJoints like this, has anyone had any luck trying to lock the end of the chain so it doesn't move at all? If I try to make the last rigidbody kinematic, or lock its position, the whole chain starts moving erratically. Or, the kinematic end bone just moves, even though it's kinematic. (Which, I assume, is due to the movement forced by the joints trying to correct.)

    Anyway, I realize this is fairly vague and specialized, but maybe someone has had some luck locking two ends of a rope/chain, while the middle continues to move dynamically.
     
  2. tjmaul

    tjmaul

    Joined:
    Aug 29, 2018
    Posts:
    468
    I also went through a lot of pain trying this and eventually settled with ObiRope. I know this doesn’t answer your question regarding doing this with configurable joints but just in case you haven’t heard of that asset :)
     
  3. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,205
    I have heard of ObiRope, and I actually bought it on sale a year or two ago figuring I'd use it at some point. So far, it has seemed that my "rope" needs were met without it, and the physics in my game is complex enough that I didn't really want to introduce the variable of a 3rd party's implementation. But that's a fair point. I'll keep that in mind if I can't find a configuration that works with plain old Unity components.
     
  4. tjmaul

    tjmaul

    Joined:
    Aug 29, 2018
    Posts:
    468
    Yeah I figured it complicates things. I’ve seen your impressive work so I’m sorry I can’t be of assistance.

    have you looked into doing the same thing but with ArticulationBodies? Same problem, it complicates things because you’ll have to deal with two types of rigidbodies, but at least their api is the same and they’re using the standard unity colliders
     
  5. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,205
    That's an interesting idea. I'll be on Unity 2019 for the foreseeable future, but this sounds like a cool feature to investigate in the future when I'm able to migrate to 2020+.