Title_AlphaPNG-compressor.png
  • Grey Facebook Icon
  • Grey Twitter Icon
To see this working, head to your live site.
  • All Posts
  • Categories
  • My Posts
HongEn Tsai
Apr 05, 2020

How to combine two animation by script

in How to Use

I have 2 animation

1.attack

2.walk


Now 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 ?

1 answer0 replies
0
1
RainyRizzle
Apr 05, 2020

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.

https://www.rainyrizzle.com/apscript-animation-eng


If you have any further questions, let us know in the comments!

Thank you.

1 comments

© 2016-2021 by RainyRizzle. Proudly created with Wix.com