I have 2 animation1.attack2.walkNow I want to make a walking-attacking animation during my character walking, just like the Pirate Girl demo. As I know the unity's mecanim can do something like this. However, is there anyway to do so by pure AnyPortrait's API ?
Hi, HongEn Tsai!
If you want to play two or more animations simultaneously, you can use "Layer".
It is the same with Layer in Mecanim, and it is also included in API functions provided by AnyPortrait.
You can enter the index of the layer as an argument to AnyPortrait's "Play" function. For example, you can assign "Walking Motion" to "Layer 0" and "Attack Motion" to "Layer 1".
The attack motion will then be combined and played in the walking motion.
Note that "timeline layers" for that parts, which will be overwritten, should not be created in the animation of the upper layer.
All other functions for animation playback provide layer parameters. These are "PlayQueued, CrossFade, CrossFadeQueued" functions.
Similarly, "StopLayer, PauseLayer, ResumeLayer" are functions that control a specific layer.
This method is similar to the Animation API of Unity.
You can find detailed descriptions of the functions on the web page below.
If you have any further questions, let us know in the comments!