Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Moving Bones without moving Mesh

Discussion in 'Editor & General Support' started by LKIM, Aug 22, 2011.

  1. LKIM

    LKIM

    Joined:
    Feb 17, 2011
    Posts:
    40
    I posted this on the unity answers site a while ago but no one responded, so I'm giving it a shot here:
    http://answers.unity3d.com/questions/145838/moving-bones-without-moving-mesh.html

    I have a rig imported from Maya which has a few Meshes in it which are driven by bones.

    During game play I want to be able to modify the mesh, and then move the bones so they align with the new mesh. For example, if I have a bone which is positioned flush with the mesh, and then the mesh becomes wider, I want to move the bone so it is still flush with the mesh.

    I have tried to move all the bones, and then apply the mesh vertex positions, but this doesn't seem to be working. When we try this, we still see the bones having an effect on the vertices.

    Is there any way to move the bones in script without moving the mesh with it? This way I can assign the mesh to be whatever values I want, and then just move the bones to match my new mesh and then hook up the bones so they drive the mesh again.

    From what I can tell, I'm going to need to programmatically re-rig the mesh and the bones, which I assume isn't going to be trivial. (Something like: destroy all bone/mesh connections, move the bones and the meshes to their new positions, and then reconnect the bones to their respective vertices with the appropriate weighting.)

    Thanks in advance,
    Liron
     
  2. ian-gabriel

    ian-gabriel

    Joined:
    Feb 24, 2013
    Posts:
    12
    Laiken likes this.
  3. BiomotionLab

    BiomotionLab

    Joined:
    Oct 9, 2018
    Posts:
    11
    @IGY-United could you elaborate a little more? that example is not really clear what's going on