Search Unity

Second Layer Animation not playing properly

Discussion in 'Animation' started by RoHofmann, Apr 7, 2019.

  1. RoHofmann

    RoHofmann

    Joined:
    Aug 15, 2017
    Posts:
    23
    Hello,

    I want to do a simple animation of a 2d character which can jump up and down, and talk. I'm using two animation layers for this, one to animate the jumping, the second for talking. The gameobject with the animator looks like this:

    character
    - gfx
    -- limbs
    --- still
    --- jump
    -- mouth
    --- closed
    --- open

    My baselayer in the animator has two states, jumping and standing still. The "jumping" clip moves gfx-transform up/down and turns the "still"/"jump" sprites on/off while the character is in the air. The "standing" clip just moves the gfx to its base position of 0,0,0. This layer seems to handle transisions and animations fine.

    My second animation layer handles the talking and has two states, "talking" and "silent". The "silent" (default) state deactivates the sprite renderer of the "open" GO and activates the "closed" one. The "talking" state alternates between the "closed" and "open" sprites by de/activating the sprite renderer component. Here I have problems.

    When looking at the individual clips, all animations do what they are supposed to do, and when running the game the correct states are highlighted in the layers as playing. But when running the game, the second layer animations don't work:
    a) the "silent" state is being highlighted in the beginning according to the animator window (as it is the default state of this layer), but the clip does not set the sprite renderers for the "closed"/"open" sprites, it does nothing
    b) the "talking" state activates the sprite renderer for "open" accroding to its clip, but does not deactivate the "closed" one. Instead, I see both sprites active when the "talking" clip activates the "open" sprite. Again, this does not happen when I preview the clip in isolation.

    My first layer has no reference to the "closed" sprite renderer, I don't know why the second layer cannot deactivate it. Both layers use different triggers to transition between states. I don't use masks in either layer.

    I have tried different settings for the second layer: both override/additive with weights = {0, 0.1, 0.5, 1} but the problem persists. Am I using a wrong layer configuration? I appreciate any help.

    Best regards
     
  2. RoHofmann

    RoHofmann

    Joined:
    Aug 15, 2017
    Posts:
    23
    Edit: restating the computer fixed it...
    In case anyone wonders, the settings which work are override with a weight of 1.

    /Please close
     
    Lukisio and Azurne like this.