Search Unity

Rope Physics: Skinned mesh getting too strechy

Discussion in 'Physics' started by ghostravenstorm, May 28, 2019.

  1. ghostravenstorm

    ghostravenstorm

    Joined:
    Oct 18, 2015
    Posts:
    88
    I'm trying to create a rope-like object in Unity that can interact with the world. I have it almost mechanically sound, but the mesh is giving a few issues.

    Here, I'm using a full cylinder mesh I had imported from 3DS Max and every 1 unit I have a Game Object with a Sphere Collider, Rigidbody, and Character Joint to make my rope behave as expected using Unity's physics.

    I have another Game Object set as a descendant of the first hinge point with a Skinned Mesh Renderer that has the first hinge point set as the root bone.

    With this I am getting the desired behaviour I want, but the mesh is streching out as it moves around.
    Is there a way to tighten how it traces the rest of the objects trailing behind?

    Image 1:
    Capture.PNG


    This is the hierachy being used (see image 2). This was imported as a rigged cylinder where each bone as a direct descendant of the previous. I have a script that rearranges the order and adds the appropriate components.

    The first most bone in the list I have set as a kinematic body so that the rope can be moved around within the editor during runtime, and that setting can be turned off to simulate a ragdoll rope. Setting the two endpoint rigidbodies as kinematic allows for the ends to be anchored to a point inspace which is what I'm looking for.

    Image 2:
    Capture.PNG

    Here's the components I'm using for the tube object holding the mesh,
    Capture.PNG

    And here's what each link in the rope looks like.
    Untitled.png
     
  2. ghostravenstorm

    ghostravenstorm

    Joined:
    Oct 18, 2015
    Posts:
    88
    I discovered that each point in my rope is actaully rotating and twisting the mesh which is causing the stretchy look.
    I switched to a configurable joint where I have the options to lock the rotations.