- Home /
How to set states of Spine animations?
Hello,
I've imported a couple of Spine animations into Unity and successfully set it up. When the scene plays, the character automatically plays a looping idle animation. Then there's a button, which triggers a dance animation instead. I just reference the dance on the Spine SkeletonAnimation in the Hierarchy. I put this function on a button, like this:
public void getDance() {
skeletonAnimation.state.SetAnimation(0, "Dance", true);
}
The dance animation is only 150 or so frames long, then I need it to return to the idle animation. However, the way it's set up now it just keeps looping the dance.
I tried to research ways I could use spine animations like you would with the "Animator" view with sprite animations that I see in all the official unity tutorials. I figured out how to get them in there. I set up transitions and now they alternate between animation states, with the blue loading bars. (Is it called mecanim or is that something else?) I watched this tutorial on how to use events, which might have been my solution, however I can't find this event panel in anything. https://www.youtube.com/watch?v=8VG2aK2AGSk
How would you recommend I set this up? I'm sure this is something so simple, but I'm so confused.
I'm quite new to game development, so the more detailed you can get, the better. I love examples. Or if there is a tutorial out there I'm just not finding, post it here. Thank you very much for your help! :)