Animation Blueprints: How to manage multiple NPC's with different animations?

Do i need to create separate Animation Blueprint for every NPC/Monster that has, for example, different walking animation? Or can i somehow create one ‘master’ animation BP and then derive from it in child classes, only changing variables determining certain animation assets? I can’t find a way to do something like this.
Basically, every NPC/monster with different animation/behavior would have different State Machine, but how to do it? The only thing i know is that we can select different State Machines in Anim Graph -> Final Animation Pose via Select node depending on variable, but of course it has only two elements available to hook up. Or is there some other way to implement it?

You can create a child blueprint based on your anim blueprint, and there is an “Asset Override Editor” that lets you select any player nodes in the parent anim graph and override the asset references in them to refer to a different asset.

You cannot modify the structure of the graph, but you can do things like add a Blend By Enum or Blend By Int node in the parent graph driven from a variable, and override the value of that variable in each child in order to choose different subgraphs for certain things.

Cheers,
Michael Noland

Thanks, the Asset Override Editor is something what i was looking for :slight_smile:

I have another similar question:
My player and NPC’s have different attack animation (around 10). Every character has it’s own availableAttackAnimations array. In attack function, i pick a random animation sequence from that array and send it through Event Dispatcher to Animation Blueprint. I have a “Selected Attack Animation” state which plays this animation, here is how it looks inside:

a9d1daf38b6c6f4a656e5034ebecc5ddce5217d2.jpeg

I had to drag in one of the animation sequences and expose it’s pin to hook up this random-selected AnimationSequence variable. It works, but the problem is, in transition rule (from “Selected Attack Animation” state to “Idle” state) i have “if remaining time (ratio) of attack animation <= 0.1” (saw this in documentation, but maybe there is a better solution) - but it gets this remaining ratio based on original animation sequence that i’ve dragged in, not on the random-selected one - which causes problems, because attack animations have different lengths.
Is there some better way to transfer random-selected animation from character’s BP to his Animation BP? Probably the problem would be solved if “Final Animation Pose” node would accept Animation Sequence variable as an input, I don’t know why it does not allow to do that…

Hi Slavq,

There have been some improvements made to transition rules to make them more robust/flexible, which will be in 4.9: Engine Features Preview 6/29/2015 - Announcements and Releases - Unreal Engine Forums

The reason the output node can’t take an animation sequence is because they’re totally unrelated things. The animation asset is a thing that contains many frames of animation, while the white lines in the animation graph are an instantaneous pose. A sequence player keeps track of time/advances it/etc…, and samples an animation to produce a pose.

Cheers,
Michael Noland

That’s great, so i’ll wait for 4.9, these new getter nodes should do the job :slight_smile:
Thanks for clearing these things up!

Slavq, you can bypass this problem by manually setting float values used in the transition rule. So you have to calculate using Animation.CurrentTime and AnimationLength (which you set manually). It’s a bit of a hassle, but it works until the fixes are out.

Good idea, thanks! This workaround should handle it, until 4.9 will come :slight_smile:

Hey, guys, I’m having trouble creating animation sequence with a working character player bp that properly blends back into gameplay mode. how would i work my way around something like this?

I’d like to help, but I’m out of loop when it comes to the current animation toolset, as far as I know, it has changed quite a bit. Last time I used animation tools like that was in 2015. Maybe someone else can help with that :slight_smile: