• Unity
  • Mixing between two animations results in VFX re-playing

Related Discussions
...

I'm working on a game using Spine. One of our characters has a "Rally" ability which buffs nearby friendly units. The Rally ability has an animation which plays a VFX during it. After the rally ability animation has played, we want to transition back to the idle animation. Everything works great, except that the VFX looks like it plays in reverse. How can we prevent this from happening?

The problem seems to be caused by the duration of the animation being shorter than the mix duration. There are several possible solutions:

  • Increase the duration of the animation which is shorter than the mix duration. (I guess the rally ability animation is the one.)
  • Decrease the value of mix duration.
  • Separate the VFX animation as a different animation and play it on a separate track. For example, if the animation of the character body is played on track 0, the VFX one is played on track 1.

There are probably others, but the above three are the ones I have come up with. I hope this will help you.

Misaki a écrit

The problem seems to be caused by the duration of the animation being shorter than the mix duration. There are several possible solutions:

  • Increase the duration of the animation which is shorter than the mix duration. (I guess the rally ability animation is the one.)
  • Decrease the value of mix duration.
  • Separate the VFX animation as a different animation and play it on a separate track. For example, if the animation of the character body is played on track 0, the VFX one is played on track 1.

There are probably others, but the above three are the ones I have come up with. I hope this will help you.

I'll try these out right away! Thanks for the suggestions. I'll let you know if it works.

One question regarding solution nr 3., when you say play it on a separate track, do you mean playing it on a separate SkeletonAnimation body? Or just a separate track? So mixing only occurs on certain tracks when you start transitioning?

blackvoyagegames a écrit

One question regarding solution nr 3., when you say play it on a separate track, do you mean playing it on a separate SkeletonAnimation body? Or just a separate track? So mixing only occurs on certain tracks when you start transitioning?

Misaki meant playing the VFX animation on a separate track, which is set via the trackIndex parameter of e.g. AnimationState.SetAnimation.