Get object 'AnimationAsset' by name

Hey all,

I have run into a problem after extending the AI as created by Peter L. Newton here.

I have two different enemies, which are children of the BP_enemy blueprint.
So both types of enemies are following the AItree nicely, with both different skeletal meshes and animation blueprints.

However, when the attack animation is called, I use the ‘Play Animation’ node, which calls an animation asset (in my case ‘Mixamo_Goblin_Sword_Slash’).
This works fine for one enemy, however, for the other enemy it does not work as the skeletal mesh is different I take.

Therefore, I get the name of mesh of the child (either ‘Mixamo_Goblin’ or ‘Mixamo_Ganfault_Aure’).
And instead of setting ‘Mixamo_Goblin_Sword_Slash’ for the ‘Play Animation’, I want to set ‘???_Sword_Slash’ (where ??? is the mesh name).

So how can I find the animation asset by name and then feed it to ‘Play Animation’?

Still have this problem.

As far as I can tell, you can only live query scene actors from blueprints. If you want to query assets, you’ll have to create an array first and fill it with the animations then use “find element” and “get” array nodes to set an animation asset variable when necessary to a specific one.

This is something that should be fixed/streamlined when Blutilities finally happens, but maybe there’s another way I don’t know about yet.