Play two 2D animation together?

Hi Unity Community,
I am working on a 2D infinite runner/shooter game. I have set up multiple animations using spriter 2D and they all work fine separately in unity. I have a gun fire animation and I want to play the animation with my run/jump animation. I spent two days searching for solution and found out two solutions:

  1. Make separate animations for each combination, Jump&fire etc
  2. Use legacy animation system and use addmixingtransform

Both the solutions seems kind of heavy and lot of rework is required. Is there any better way of doing things here ? do we have any way by which we can mimic avatar mask kind of thing for 2D ?

You could make your player and your gun seperate objects. They could have different animators and thus animations.

The gun could still be a child of your player → it gets moved correctly.

Is that an option? :slight_smile:

Thanks for the answer Brullix3000. I have my palyer and gun as separate objects only. But when I press fire key animations didn’t mix properly. I found the solution though. :slight_smile:

I needed to make fire animation with bare minimum keys. in my case just hand and gun and remove all other keys from the fire animation. and keep fire animation on second layer.