Download

How do I get my character to perform an AnimComposite, which has been passed to it as an object?

I have a Basic patrolling AI, who goes between PathNodes (shout out to Ian Shadden! :D), and each PathNode has an Anim Composite variable attached, and the aim is to have the NPC use it to run the series of animation sequences, before moving off to the next PathNode.

It’s a standard set-up (if there is such a thing), with an NPC BP, NPC Controller BP and an NPC Anim BP, which I can access (together with the relevant Anim Composite) inside an AI Task in my Behaviour Tree. How do I get the NPC to act out the Anim Composite?

Is there a better way of doing it? Am I doing the right thing using an Anim Composite?

Ah, I think I’ve solved it. I can Play Animation on the NPC’s Skeletal Mesh Component.

I thought that Play Animation only worked on Animation Sequences, but it also works on Composites (which are just a series of Animation Sequences anyway:D).

Now I just need to get the Skeletal Mesh Component from the NPC BP. How hard could that be?:rolleyes:

That’s all done, now. I can start with the NPC BP object, Get Component By Class (The Component Class is SkeletalMeshComponent), and plug the Return Value into Play Animation.

The result does muck up the animations afterwards, but that’s a different issue.:rolleyes: (ANSWER: You have to get the Sequence Length of the Anim Composite, and plug it into a Delay node, and then Set Anim Instance of whatever Anim Class the Skeletal Mesh had before it Play(ed) Animation.