• Runtimes
  • [UE4] How to properly Animate in UE4

Related Discussions
...

I am thoroughly confused as to how animation works.
I am very accustomed to Animation BP and flipbooks in Unreal but the system Spine uses makes little to no sense to me.
Even something as simple as starting a walking animation once movement occurs is complicated by the fact that it doesn't work as the rest of Unreal does. Every other way to animate characters in Unreal sets animations and flipbooks once and plays the loop normally even if it's setting on a tick (which makes sense because if speed > 0 then don't Idle and don't continuously set the same animation) but trying to do this with Spine continuously sets the animation to start over. Adding an animation to the queue only waits until the Idle animation has completed its current cycle. Is there something I'm missing? It seems like having an actual character that would normally have a large state machine to control its animation would either be impossible or a logistical nightmare with the Spine Runtime.

Hopefully someone can shed a little light and make it easier because as of now this makes Animation BP's look like a cakewalk.

Thanks

Hi, think of the Spine Runtime as loading animation from a 3D model manually with the "Play Animation" node, not with the built in state machine.

You can load a Spine animation and set the loop to true with the "Loop" variable in the "Set Animation" node.

About the state machine, that's true, my solution was to get a State machine lib (this is the one I got for this purpose: https://www.unrealengine.com/marketplace/gc-fsm) and coded in blueprints so it automatically changes states (and animation) automatically. For example, if velocity Z is below 0, then it executes the falling animation.

This is the state machine I created with GS FSM for the character:

And this is inside the run state, every tick I update the variables from the character:

It looks complex but it's actually simple:

  • Update a set of variables on the tick function on the character
  • Check the variables in each state so you know when you need to change state (not all states need to check all the variables)
  • Change the animation every time the character change its state, loop it if you need it (in my case, I need run and idle looped but not falling)

I recommend GC FSM (the library I used) because it has visual feedback in case you need to debug, and because it's really easy to use, but you can use any state machine library.

Hope it helps.