Search Unity

Animation controller plays only default animation.

Discussion in 'Animation' started by onionface, Sep 12, 2018.

  1. onionface

    onionface

    Joined:
    Dec 25, 2012
    Posts:
    7
    Hi,

    So I've been stuck on this for a while, hoping to get some tips.
    I have an animation controller for this character's expression and would like to be able to assign a different animation to the face for each scene in the game.

    The setup: I have a 12 scene click adventure type game, each scene is a still image with some small animations, such as the character's faces - which blink and change expression from scene to scene.

    The problem: even when I attache the "happy" animation to the character inspector, it still plays the "sad" animation. It seems that unity is taking whichever animation is set to default in the animator, rather than the animation I assign in the inspector for each scene.
    This would not be such a big issue, but whatever I do in the animator ends up getting used as default in every scene.
    And if I delete an animation from the animator, Unity does not find when I try to select it from the inspector.

    So how do I make Unity use the animation assigned in the inspector?

    thanks!
     

    Attached Files:

  2. mbbmbbmm

    mbbmbbmm

    Joined:
    Dec 28, 2013
    Posts:
    58
    You are trying to mix Mecanim with the old Legacy Animation system. I think it won't work that way...
     
  3. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    441
    If you want to assign animations in the inspector without the need for an AnimatorController then my Animancer plugin sounds like exactly what you're looking for.
     
  4. onionface

    onionface

    Joined:
    Dec 25, 2012
    Posts:
    7
    @mbbmbbmm thanks, I ended up just making a new controller for each animation. It might eventually get a bit messy but will solve that when it happens.

    @SilentSin cool, I'll check it out.