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. Dismiss Notice

Question Two Sprites With Same Animator

Discussion in '2D' started by bwlgeo, Jun 20, 2023.

  1. bwlgeo

    bwlgeo

    Joined:
    May 10, 2022
    Posts:
    12
    Howdy, pretty new to gamedev so apologies if this has been answered before and I just couldn't find it.

    I'm dealing with 2D pixel art animation and I've been running into a bit of a hurdle. I want to make it so that I have two parts of a fully drawn sprite animating independently but synced and controlled by the same animator. To clarify, the reason I say bespoke here is because I'm not trying to do transforms, but taking a fully drawn pixel image, splitting pieces, and having different pieces animate at different times using the same controller.

    For example, say I have an idle animation, a running animation, a shooting animation, and a reloading animation. I want it to be possible to play the running animation whether the player is shooting or not, but also be able to play the shooting and reloading animations whether the player is running or not. I I'm just the entire drawing as one sprite, say, shooting while running will restart the legs part of the running animation so that the arms part will go the shooting.

    I've tried having them be separate game objects with their own animators, but keeping the two synced is rather unreliable. Any way to maybe have the same animation controller play two animations at once?
     
  2. karderos

    karderos

    Joined:
    Mar 28, 2023
    Posts:
    376
    first problem - does every frame of your shooting animation line up with any combination of the running animation?

    I have thought about this because I wanted my character to run and attack at the same time

    2nd problem - can an animator play 2 animations? no
    youll just need 2 animators
    even if you could use 1 animator only, how would you sync the 2 animations, you would have the same problem

    For my case I also thought to create a attacking while running animation but theres too many combinations, I just gave up on it

    Its too much sprite work, if you look for examples in any game I dont think you will find any game that the devs went through this trouble to make pixel art chars animated so freely
     
  3. Avalin

    Avalin

    Joined:
    Oct 12, 2018
    Posts:
    98
    Try to look into Animancer, there's a free Lite version. I think the HybridAnimancerComponent might be what you're looking for