So I’d expect that when you use Sub Anim Instances you should be able to just plug them together and have everything work. However most of Unreal Engine 4 and games using it are written with the assumption that there are no Sub Anim Instances and everything happens on the root AnimInstance. The GameplayAbility system is one. Most of the API’s that work with a skeletal mesh. Etc…
If you were to take any Anim Instance today, and refactor it into sub instances, chances are many things would stop working completely. If a child sub instance is now responsible for playing montages, they simply won’t play. Anim notify events will no longer be received if you move the logic to a sub anim instance. Pose snapshots will no longer be found.
Here’s a shameless plug for my Pull request that I’ve had out for a while that fixes all of this, along with a few other issues. Hopefully it can get some attention.
My pull request makes it so SubAnimInstances just plain work as you’d expect. The game logic can all still operate on the SkeletalMesh->AnimInstace reference directly, and the children will do all the expected behavior.
It’s a somewhat simple solution where the sub instance parents and children recursively talk to each other.
I did have an idea for an even bigger overhaul where there’s a global datastructure in the skel mesh component that tracks the play state of things like anim montages and all sub instances reference it, but I had a feeling there are some edge cases I may miss and it’s better to keep it simpler so it’s more likely to go in.