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

Animating a character with multiple pieces

Discussion in '2D' started by Marscaleb, Sep 18, 2015.

  1. Marscaleb

    Marscaleb

    Joined:
    Jan 7, 2014
    Posts:
    992
    So, how can I animate a character built with multiple pieces?
    For example, the British Bean character used in the 2D platformer demo. Instead of being built by a series of sequential images, he is built with a collection of individual parts that are animated together; like the feet move back and forth as separate objects from the body.

    I'm thinking a particular character I am building would look better if I animated him like that, but I don't know where to begin. Sure I could create a gameobject with several children to be each part, but how do I animate those parts so that they move around as I need them to?
     
  2. alijib

    alijib

    Joined:
    Nov 14, 2014
    Posts:
    17
    The process is mentioned in 2d platformer project (Tower Bridge Defence - the one with a spaceship , bridge ). the most important thing to watch out for multi part animation is pivot. Place your pivot properly and then you can animate the sprites easily.

    https://unity3d.com/learn/tutorials/modules/beginner/2d/2d-overview?playlist=17093

    Simply put. Add a empty game object to the scene. Add your multi sprite to empty game object as child.
    Add an animation to the empty game object (its a parent of all) in animation , add property , by selecting the desired sprite and working on it.
     
    Last edited: Sep 18, 2015
    orchard800 and theANMATOR2b like this.
  3. Unexpected_Persona

    Unexpected_Persona

    Joined:
    Jul 23, 2015
    Posts:
    9
    In my (fairly limited) experience you'll mostly use rotation to animate more realistic (i.e. all body parts are connected) sprites, while a Rayman-style sprite you can probably use the position transform option. Try to make sure all the pivots are in the right spot, as otherwise the rotation can result in disconnection of limbs from the primary sprite.
     
  4. eses

    eses

    Joined:
    Feb 26, 2013
    Posts:
    2,637
  5. Marscaleb

    Marscaleb

    Joined:
    Jan 7, 2014
    Posts:
    992
    So wait, there's an in-editor system for creating key-framed animations? Where is a tutorial on how to use it?
     
  6. eses

    eses

    Joined:
    Feb 26, 2013
    Posts:
    2,637