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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Animator : how to organize additionnal anims , layers or override?

Discussion in 'Animation' started by antislash, Oct 30, 2015.

  1. antislash

    antislash

    Joined:
    Apr 23, 2015
    Posts:
    646
    hey folks
    i'm stuck at wondering what is the best way to organize anims in the animator.

    let's say i have a basic "locomotion" set and i want to add a "combat" set with proper anims
    until now i tested combat using "layers" and masks so the character can hit etc

    are layers the best option ? or should i use more blendtrees ?
    or should i use a separate animator component to "override" the the locomotion set ?

    any help muuuch appreciated
    thanks guys

    Victor
     
  2. medhue

    medhue

    Joined:
    Aug 24, 2014
    Posts:
    176
    Your guess is as good as mine. :)
     
  3. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,533
    ^ Likewise. :)

    Using a separate Animator component to separate runtimeAnimatorController will reset the parameters every time you switch, so that's probably not the best option.

    I've found that it works well to use a single Animator, a single animator controller, and a single layer for each avatar mask (e.g., whole body, upper body, and head).

    In each layer, create a separate sub-state machine for each set (e.g., unarmed, sword, bow, pistol, rifle, etc.). To change sets, transition to the corresponding sub-state machines.

    It's not perfect, but it has a few advantages over blend trees and sync layers. In particular, you can have completely different animation states in each, or at least animations with different speeds and lengths.

    Take a look at Opsive's Third Person Controller. The developer posted screenshots of some of the animator controller's setup in the forum thread. You can get an idea of how it works from the screenshots.
     
    theANMATOR2b and antislash like this.
  4. medhue

    medhue

    Joined:
    Aug 24, 2014
    Posts:
    176
    Let me just say this. Pretty much every single character I've animated has a unique set up in Unity, depending on the character, the game, and the factors involved in that game. Throw in coding preferences, and I'm not sure it is possible to say any way is better or worse.
     
    antislash likes this.
  5. antislash

    antislash

    Joined:
    Apr 23, 2015
    Posts:
    646
    hi guys, sorry for late reply..
    yep, i figured it out, and found that having a unique animator for one character is the best option.
    then , as said, using layers and layers with states inside them triggered by parameters.
    thanks a lot for your help guys, very appreciated

    Victor