So I ran into an issue with my design idea. Nested anim layers are currently not supported. Is there ever a plan to support nested anim layers or is it something that is impossible to ever do due to some underlying implementation details?
It can be very powerful to support nesting anim layers so we can essentially emulate OOP in anim blueprints and make things very modular. It’s like I’m extending a function and calling other functions from that function in C++/Blueprint, only the functions are anim layers. The fact that we can’t currently nest anim layers throws a wrench in my design and I’m back to duplicating code between different anim blueprints.
My plan was to have a base anim blueprint with a state machine for my locomotion, and not copy paste that logic between all my characters. Each state would take an anim layer as its output, but each character can implement their states how they want. But then I had an intermediate anim blueprint built for handling characters that have forward and backward animations only, and use the new pose warping feature to add side to side motion. This would essentially have 3 layers of nested anim layers.
I previously had this working without anim layers at all and just used cached poses. I used linked anim subinstances 3 layers deep. However this doesn’t play well with the state machine transition get relevant animation remaining time function. I was no longer able to easily transition out of a jumping animation, for example. Anim layers do work with that function.
God the struggle I’m facing. I am right there with you!! One animgraph for base locomotion to avoid copying all the ■■■■ variables! I’m messing with it too to try and figure out how to get it to work. It’s really hard for me to understand how of all things, this is a limitation
I also struggled very hard with having a nice modular set of anim graphs each doing their own thing, that are linked together in one main graph. There seem to be many bugs in unreal right now when using sub anim graphs. For example, update animation and threadsafe update animation functions failed to work properly deep in some C++ blueprint layer that even I couldn’t debug due to something not working right at the blueprint VM level. I filed bug reports for it at least.
However, Unreal seems to support linked anim layers pretty well since it seems they use that a ton in their games like Fortnite.
I ended up deciding to make one giant monolithic anim graph template that runs most of the main behavior of my characters, and using linked anim layers for a few of the things specific to each skeleton.
I originally wanted only humans to have some of the more advanced behavior, and my game’s monsters to have simpler anim graphs, but then I decided that every character will have the same core anim graph template for now. Making things more modular just isn’t working.
Hey yeah so I eventually figured out how to properly use the anim layers. It took a few tries but I got the concept now on how to combine complex ones with IK and stuff
My IK is actually in the post process blueprint. I don’t know if this is still true since I haven’t tried it, but many versions ago, my character’s VR hands lagged behind by a frame. If the IK is done in the post process blueprint, they’re lined up perfectly.
Of course, doing IK in the post process blueprint adds its own problems, like the mesh being badly deformed any time you look at it in the mesh editor. I have 0 transforms coming in as hand destinations. Gotta add checks like, is there a valid pawn owner. Then the mesh is still messed up when looking at the pawn in the blueprint viewport and level editor, but I’ll figure that out later.
I have a main template animation blueprint that works for multiple characters, using linked layers in each of the states.
But I’m struggling to figure out how to make it modular, like what if I want one state machine to behave just a little different for one character than others. Or if I want to load in one state machine only for certain characters, but keep everything else the same, if trying to be optimal.
Been experimenting with Linked Anim Graphs, but can’t get them working yet while they use Linked Layers for states too.
Do you have any advice, with how you made your monolithic anim graph?