• RuntimesUnity
  • State machine for SkeletonAnimation?

The documentation recommended SkeletonAnimation for using spine in Unity, so I'm wondering if our historical workflow is missing some modernizations. We often need our spine characters to maintain states; however, our artists tell us they would like to use features only found on the SkeletonAnimation spine object.

Is there something we're missing/overlooking that would allow us to have spine characters that maintain states while using the recommended SkeletonAnimation spine object? Would we need to roll our own state machine system tooling/editor window to work with SkeletonAnimation in that way?

Thanks!

    Related Discussions
    ...

    To maintain states with Spine characters using the SkeletonAnimation component in Unity, you would indeed need to implement your own state machine system. The SkeletonAnimation component is recommended for its complete feature set and flexibility, but it does not inherently provide a state machine like Unity's Mecanim system. You can create a custom state machine using C# scripts to manage the states and transitions of your animations. This involves storing the current state, handling transitions, and using the SetAnimation() method on the SkeletonAnimation component to change animations based on your state logic. This approach allows you to leverage the full capabilities of SkeletonAnimation while maintaining control over your character's states.

    jhoferLNW2332 There is an example of using both StateMachine and SkeletonAnimation in the example included with the spine-unity runtime, so please take a look at it: Spine Examples/Other Examples/StateMachine SkeletonAnimation/Mecanim Logic SkeletonAnimation View.unity

    Here's what it looks like when you play back the example scene:

    The example scripts (DummyMecanimControllerExample and SkeletonAnimationHandleExample) attached to the Hero GameObject have many comment lines explaining how it works, so please refer to them for more information.

    Thanks Misaki, I'll have a look at all that.