• Unity
  • How to use the Animator/Mecanim with Spine

Related Discussions
...

I've seen quick explanations of the mecanim but couldn't find any details on it.
So I generated the mecanim controller. How do I create a states with the different animation?


27 Dec 2016, 17:03


Oh, I found it.
Create an empty state, then in the motion param, select the animation you want from.

7 days later

So I've set up the states and assigned the motion animation but the animation does not play. I'm sure I can do it with code by playing the animation on a

override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)

But was wondering if it can be done without code.


04 Jan 2017, 16:20


I made a quick video of how to use the Animator with Spine here

15 days later
Pharan wrote

Otherwise, we recommend just using SkeletonAnimation instead of Mecanim.

I'd need a better explanation about this statement. :think:
I found a very good asset called Platformer PRO (http://jnamobile.com/), but the support says it works with spine via mecanim, so I really need to know what i'd lose adopting the mecanim solution (SkeletonAnimator?) and not the SkeletonAnimation's one.
Thank you

luigi.freguglia wrote
Pharan wrote

Otherwise, we recommend just using SkeletonAnimation instead of Mecanim.

I'd need a better explanation about this statement. :think:
I found a very good asset called Platformer PRO (http://jnamobile.com/), but the support says it works with spine via mecanim, so I really need to know what i'd lose adopting the mecanim solution (SkeletonAnimator?) and not the SkeletonAnimation's one.
Thank you

If I understood correctly :
It basically "bake" your animations or pre-record it, that means you pretty much lose all the Spine features in runtime : so blending and mixing won't work anymore.

RemDust wrote

If I understood correctly :
It basically "bake" your animations or pre-record it, that means you pretty much lose all the Spine features in runtime : so blending and mixing won't work anymore.

So you should use Mecanim blending trees. Are they inferior compared to spine's?

You do not HAVE to bake your animation to use Mecanim.. that is only if you want to distribute your animations to people who do not have the spine runtime added to their projects etc.

If you export your spine character to your Unity assets and then drag it and select Spine Animator, a Mecanim animation controller will be created by the asset which is then used in Mecanim. You need to understand how Mecanim works for this to make sense.

What this thread is describing is how to use Mecanim with SpineAnimation (not to be confused with SpineAnimator). I also made a short horribly explained thread with the same idea here: Mecanim FSM + Skeleton Animation Example

Spine 'Mixes' animation by default. No need to use the blend tree.