Search Unity

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

  2. Unity 2022.1 is now available as the latest Tech release.
    Dismiss Notice
  3. Improve your project's performance with our new guide on profiling in Unity.
    Dismiss Notice

Animator Controller and Multiple Hierarchies

Discussion in 'Animation' started by madguru, Mar 18, 2014.

  1. madguru

    madguru

    Joined:
    Nov 1, 2013
    Posts:
    7
    A question about how best to set up animator controllers for multiple hierarchies.

    I am using a setup based on the Third Person Character setup from Unity.

    It works very nicely for the character, and I have been adding new animations and controls to the setup.

    I have a weapon prefab with a few bones and blendshapes, which I parented under an empty GameObject under the character forearm. To create animation controls for the weapon, should I create a unique animator controller applied to it, with unique scripts for the weapon, or is there a way to use the character animator controller for both the weapon and character?

    Currently when I try to use the same animator controller for both, upon firing the weapon, the character squats down, which I think is due to hierarchy mismatch. All weapon animation fbx files contain only the weapon and its bones/blendshapes.

    Thank you,

    Adnan Hussain
    http://www.madguru.com
     
  2. madguru

    madguru

    Joined:
    Nov 1, 2013
    Posts:
    7
    Still trying to figure this out.

    1. I have a prefab of a character with an animator component and animation controller setup.

    2. I am adding a weapon to that character, which has its own animations and of course a different hierarchy than the character.

    3. I parented the weapon under an empty gameObject parented to the character forearm.

    4. Weapon gameObject has its own animator component and animation controller.

    I have scripts setup on it but I think this is not the right way to set this up. The weapon animation does not work.

    I want to ask if this is the right way to setup the weapon, or should the weapon animation controller be the same as the character animation controller all with one animator component? I did try this, but due to the difference in hierarchy, when I press the button to fire the weapon, the character goes down.

    Any thoughts?

    Thanks,

    Adnan Hussain
    http://www.madguru.com
     
unityunity