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

is it me or mecanim is complicated?

Discussion in 'Animation' started by Gohan1, Feb 25, 2016.

  1. Gohan1

    Gohan1

    Joined:
    Nov 20, 2015
    Posts:
    28
    as you add more states the transitions exponentially increases, even with substates, any state, enter, exit. It's just unpredictable and hard to debug. How do I deal with this?
     
  2. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,521
    Use Any State more or, better yet, control some transitions from code using Animator.CrossFade.
     
  3. Gohan1

    Gohan1

    Joined:
    Nov 20, 2015
    Posts:
    28
    I cant believe everything is much more predictable with Animator.CrossFade. I don't have to keep track of all the transitions. I just have to structure my code differently, but the question is. Is this the right way to do the animations?(sprite Animations) not one of the legacy stuff?
     
  4. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,521
    I think it's a good way. A lot of the more advanced animation controllers, such as Opsive's Third Person Person Controller, do it this way.

    If you were using legacy animation, everything would have to be done like this, and without all the benefits of Mecanim such as retargeting, IK, visual layout of animation states, the option to use visual transition arrows on the canvas, etc.
     
  5. 00christian00

    00christian00

    Joined:
    Jul 22, 2012
    Posts:
    1,032
    Can't you transition also from any state immediately if you want?
    You should achieve the same result without crossfade by code.
    That way you don't have to tinker with code and can experiment in the animator.
     
  6. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,521
    Yes. (I mentioned this in my first post.) But it still leaves a lot of transition arrows on the canvas, and also the conditions of all Any State transitions are evaluated every frame. If you have a lot of them, it could be a performance concern. But, then again, if you tinker with code you lose the advantages you stated. I think there's a balance. In my controllers, I have no transition arrows between major states (e.g., unarmed, melee, pistol, etc.) and switch between them in code. But inside each major state I use transition arrows.
     
    theANMATOR2b and 00christian00 like this.