Struggling with meshing animation graphs with behaviour trees, it possible but very inelegant (very unlike unreal).
Then I wondered if my approach was all wrong, maybe the two aren’t meant to be used in conjunction.
Would this be a fair appraisal of each system ?
Behaviour trees are for AI, you trigger specific animations directly from the tree.
Animation graphs are really meant for your character and respond to your inputs, they dictate what possible states the main player can enter into.
things is that you are not supposed to call animation from the AI system, you have to do it from the other classes from your game like weapon class. Opinion not a must do in order to…
I want a character to walk to a chair and sit down.
The behaviour tree can find a chair in the level, move the character to the chair and play the “sit down” animation. I don’t really need the anim graph at all. Is that what I should be doing ?
Where do anim graphs fit in - what purpose do they solve ?
Anim graphs let you move and control each bone directly via the Skeletal Control Nodes, and this allows you to animate your skeleton procedurally instead of being limited to playing pre-defned animation sequences. AFAIK, you can only use these nodes inside an anim graph.
In the normal event graph, you can play pre-defined anim sequences for a skeletal mesh, but you can’t control the bones directly, unless you use a PoseableMesh component instead of a SkeletalMesh component, but then you can’t play anim sequences. Also, AFAIK, the nodes available to control bones in a PoseableMesh are more limited than the ones available in an anim graph.
Anim graphs let you mix simultaneous animations on the same skeleton, mix procedural with sequences, etc., it’s really powerful. It’s not “event driven” like an event graph, though - it executes every frame, but the nodes have “fast path enabled” if you use them correcly.