Download

How to play a complex Animation Montage correctly?

Hello,

I have an Animation Montage:

StandToProne -> ProneIdle (loop)
ProneFire1 (loop)
ProneFire2 (loop)
ProneReloadRifle (loop)
ProneReloadShotgun (loop)
ProneDeath1
ProneDeath2
ProneToStand

How to play this Animation Montage correctly in the Animation Blueprint (EventGraph). For the loop sections there are branch points.

I use:

For testing reasons I use keys to prone, fire and reload to see if it works. My sections seems to play only once (only fire seems to work correctly because it comes back to the Idle section). I know it’s a complex problem but in general how to play the Animation Montage sections?

Though you should be able to make this work, I’d suggest a different approach. The state machine exists for this reason and I suggest you take a look at that. It’ll allow you to easily blend your various states with some simple rules, either based on button press or timing or whatever really, whatever is required to make it function like you need to.

So, the idea being that you use state machine to drive your base animations, moving around, idle, etc. On top of that you can then use montage to trigger specific unique animations, like an attack, for example. Again, though you probably can use purely montage, or even purely state machine to do it all, but it helps to use a combination of the two to make life easier. So you use what makes sense for that state.

If you’re set on using only montage, then you will need to really work out your combinations and how you trigger them… etc. With montage when you call an animation, it’ll play through and then stop. If it’s a loop, it’ll play that loop until you call another animation or stop the existing one. Without a state machine to fall back on, you’ll need to make sure you’re always calling some animation. Though I’ve never attempted this specifically, in theory you should be able to get what state machine allows you to do, but with much more effort and taking care that you cover all your bases.

Thank you for your suggestion.

I know that state machines are easier to use but if you have a lot of animations, you are forced to make many conditions to set the rules. A lot of code. So I think we should avoid of using state machines only if our animation system is complex (you see only a part of my animation system, for prone). For movement, the perfect solution is a Blend Space, and there are animations that can be used in composite. In my example, the composite can be StadToProne and ProneIdle as one unit (state machine). However, it doesn’t solve my problem where I need to make one animation system for prone. Animation Montage is the best solution. I need to make those animations work without so many pressed keys. One key for every animation? How many keys would I need to run all these animations?

Because nobody replied, I was able to solve the problem partly and in general it works. I don’t know how to control only the death animations in prone, because I have death animations set when the character stands. Having death animations in standing and proning is too complex for me now. However, all other animations work.

I think Epic Team (or any advanced user) should make a good tutorial regarding this topic because users usefully use state machines only and they avoid of using animation montages. It’s not good for complex animations systems. And in general I think animation montages are very good assets so we shouldn’t be afraid of using them. The official documentation isn’t enough and no unofficial tutorials in the Internet. As a previous Unity developer, I’m slightly amazed why there are no good tuts for complex topics and at the same time Epic Team wish their product was popular.

My solution:

Also remember that you can blend state machines. So you can set up one state machine for stand, a separate one for prone… etc. Then blend them appropriately. Having special death animations should not be too bad to deal with as long as you track your states and branch it out to call the correct montage.

So, just as an example, for my game I have typical running, jumping… etc. That’s the normal state. Then I also have a state where if you stand on a wall, or ledge. So that is 2 different state machines and I blend them across as needed. Of course idle to run is a blend space but used within the state machine.

Of course with more animations, it all becomes more complex, but it will either way, more means more complexity no matter how you look at it.

But anyway, I am by no means trying to tell you what to do, just explaining my point of view. If your system works, that’s really cool and just shows another approach, which is always cool.

Yes, sure. Could you tell me how do you blend state machines? I would like to use that in my project.

You can use the node called - Blend Poses By Bool

While it is great that you have got your code working, using state machine should keep things things more maintainable and allow you to make changes more easily, should you need to.

Blend Pose By Bool, Blend Pose By Int, etc., but how to use them? Can I use the variables from the character blueprint? Maybe any images? It would be useful for many users.

I only hope I use my montage correctly. It works, but I’m not sure.

There are many nodes in Animation Blueprint and they are very useful, but how to use them it’s unknown for many people. The official documentation should describe all in detail. Unity has a very good documentation and therefore has much more users. UE4 is the best game engine for me, but its documentation should be more descriptive. I hope some guys from Epic will read my words and make a decision to improve the official documentation.

Sure, here’s a shot of one of my setups I use… a simple one to show clearly what’s going on.

So, this shot is from my Character Blueprint and it shows that I set the boolean value when I pick up a torch.
BPB_Ex01.jpg

So that boolean I get from my Character Blueprint and in this shot I use it in my Animation Blueprint to blend over to the new State Machine.
ec4e144e41f405b888fbaaf2b3dc51fdfc49bc2d.jpeg

I’m not showing the Event Graph, but I mean, you just get the value there, so that’s the same as getting any value there.

Thank you! I see I still have much to learn :). I think it can be a powerful feature when you can control all those nodes.