Aggressor написавThanks @BinaryCats and @Rob I am going to look at both of these.
However, @BinaryCats, because our game will have so many weapon types (with endless numbers of sprite variations) we absolutely must do it dynamically. I would never want to do something like this via the animator sprite swapping. I would however like to get blending working where an idle pose has default arm movements, but if there is a weapon in it, then it blends with that weapon types idle holding.
hmm thinking about it. I assume you have a few different weapon types just with different weapons, and lots of different characters.
There is pretty much no way around not using spine to determine how the character is holding the weapon. I would propose you make another spine file. This file would store the information about how to hold each type of weapon (weapons you hold the same way).
I would suggest:
In this project create the bones which would change depending on the weapon
-
Add a new animation and in that animation position the bones in the correct position
-
export the json
Then in the code
Cycle through the animations and store the bone data for the bones in that animation
when switch to a weapon take this data and apply it to the bones
This assumes you have a naming convention, and that all your bones are set up in a similar way.
If the characters are vastly different from each other... God help you.
(I can try to explain this more if you don't understand, its basically applying one animation to all the characters (so you don't have to have thousands of anims))