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. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Question Stop Animation From Playing On Character's Limb

Discussion in 'Animation' started by cherokeelakes94, Oct 31, 2022.

  1. cherokeelakes94

    cherokeelakes94

    Joined:
    Jan 22, 2015
    Posts:
    3
    Hello. I am using a character that is separated in several parts: Head, Torso, Upper Left Arm, Lower Left Arm, Upper Right Arm, Lower Right Arm, Left Leg, Right Leg and so on. This character was animated in Mixamo. I am wanting to implement removeable limbs. My initial thought do this was to stop the animation from playing on one the cut off piece and then use physics to control it from there. I cannot figure out how to stop it from playing on any of the individuals meshes though. Unparenting it from the character does not work and neither does setting the root bone of the Skinned Mesh renderer to null. I can delete the bone associated with the mesh, but the scaling and position then of the mesh is off. Any suggestions on how to approach this?

    Thanks
     
  2. tcz8

    tcz8

    Joined:
    Aug 20, 2015
    Posts:
    498
    I’ve been looking into this, and although I haven’t tested it myself, I believe you’re looking for animator.Rebind().

    Un-parent the limb, run the command, and the animator should discard it. I’m hoping it also allows reconnecting to the animation by re-parenting the limbs.
     
    Last edited: Nov 24, 2022 at 1:12 AM
unityunity