Hello, I have a question, I want to make a 2D animation in which the character attacks, for that I have 2 sprite sheets, one in which the character is making the attack gesture, and another in which there is only the weapon with which he attacks, I want to be able to do the animation on the character object, so that the same animation works with two sprite sheets at the same time.
Hello,
I’ve just had the same application.
I managed to make it by having a naming convention on my sprites.
Example :
player_attack_1
weapon_attack_1
You can easily make a script to rename automatically your sprites from a spritesheet.
You need then 2 gameobjects with a spriterenderer on it. One for the player, another for the weapon. Make sure their position origin is the same point in space.
Finally you have 2 options :
Use unity animation system, make the 2 separated animations at the same framerate (1 sprite every 0.2s for example) and trigger it at the same time to make things work.
Or my solution which is more automated. I made my own animation script which manually changes the sprite of my spriterenderer based on the name of the sprite.
Example :
First renderer plays : player_attack_1
Second : weapon_attack_1
Thank you very much for solving the problem