Search Unity

Reusable Animation with different Sprite Sheets

Discussion in 'Animation' started by MauricioEF, Apr 20, 2021.

  1. MauricioEF

    MauricioEF

    Joined:
    Sep 4, 2020
    Posts:
    10
    This have been a problem for a lot of years and I couldn't find something useful, so I'm reopening a thread, I hope you can help me with this.

    I have 2 spriteSheets as you can see in the next images:

    Character.png Character (2).png

    The player and the NPC. they should have exactly the same animations, but I had to do the animation files and the animator controller again. I want to put more NPCs with same SpriteSheet but different textures. How can I do this without doing more animations + animators?
    Thanks in advance.
     
  2. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    Check out Animancer (link in my signature). It has a Sprite Renderer Texture Swap script that does exactly what you want.

    I obviously recommend using Animancer for all your animations, but that script doesn't care what animation system you're using so if you want to keep using Animator Controllers you can just delete everything except that script then open it and remove the
    [AddComponentMenu]
    and
    [HelpURL]
    attributes at the top.

    Here it is in action:
    SpriteRendererTextureSwap.gif
     
    Last edited: Apr 21, 2021
  3. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    916
    salvadorelmejor33 likes this.
  4. MauricioEF

    MauricioEF

    Joined:
    Sep 4, 2020
    Posts:
    10
    Hi, thanks for your reply. I tried to implement it but I still don't know how can I handle an animation controller in order to have more than 1 animation. I don't know if I can find a tutorial with a full animated character with this method.
     
  5. MauricioEF

    MauricioEF

    Joined:
    Sep 4, 2020
    Posts:
    10
    Hi! Thanks for your reply. I'm looking at animancer documentation and it looks very good! I'm still very new with Unity, I don't know if you have a Tutorial where I can see how to make a full functional character with animations using this asset? Thanks in advance
     
  6. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    The State Machines examples go through the general ideas of how you can build a character's logic and the 3D Game Kit example remakes the character from Unity's 3D Game Kit in Animancer.
     
  7. MauricioEF

    MauricioEF

    Joined:
    Sep 4, 2020
    Posts:
    10
    Thanks for the help!