Search Unity

Spritesheet character with different independent animations

Discussion in 'Animation' started by aramosgz, Jan 22, 2020.

  1. aramosgz

    aramosgz

    Joined:
    Jan 28, 2016
    Posts:
    19
    Hi!
    I want to be able to animate different parts of a character's body independently and I can't figure out how to do it.
    I have an animation for the head and another for the legs, made by multiple .png's each. Head animation (blinking) would take place randomly, whereas legs will only animate when the player is moving.

    I made an empty GameObject (Player) with 3 children: head (initial head sprite + animator component), chest (only 1 sprite, as it's not going to be animated) and legs (same as head).

    What I tried was having the same Animator Controller for the head and the legs, with 2 separate layers, each with different states (blink/no blink, walk/no walk, each with their respective animations (made up of the several .png files)). Transitions are controlled by different parameters.
    When changing these parameters values no animation happens. I tried changing the different animator layers' weight and still nothing happened. The player would move without any animation.

    What am I doing wrong? Is there a different approach to animating characters with spritesheets more suitable?

    Thanks!