Repository navigation
14. Creating composite animations using layers
Since version v2.2 it is now possible to create composite animation sequences to render layered characters.

To enable this behavior, navigate to the bottom left part of the AnimationSource editor and locate the new "Layers" section.

In here, you can configure your Animation Source to allow for extra composite layers for rendering additional animations that are synched with your main render component. In this example we have added a total of 6 additional layers to be rendered alongside the character and have given them the correct offset so they can render on top of each other.
Now, we can go into the details of any AnimSequence and setup the base body animation (now called "Animation"), and the extra composite layers to be rendered on top

This enables us to create an animation piece by piece and even apply skins to each body part separately to create a fully customizable character which can be used as basis for a 'character customization' like mechanic on games.
ℹ️ Its important to note that each animation layer has been created to perfectly match in size and duration to the main body part, so effectively they run in tandem overlayed over each other, creating the composite animation.
By default, you don't need to do much to set up your character to use the layers you created, as the tool will automatically create the components required to render the animations and layer them correctly, this is because we have the following option enabled by default on the Animation Component.

Letting the plugin build the layers by itself is the easiest way to get started with your composite character, but this have some caveats:
- The layers are only built when the game starts, which could have some adverse effects on performance if too many characters are loaded at the same time.
- Because the layers are built on Begin Play, these layers are not visible while not playing on the editor.
- You don't have easy access to them to modify the render components in any way.
Because of this, its recommended that instead, you manually create the layers on your blueprint and assign them to the composite layers array, to let the tool know how to render them. This also makes it easy to visualize the character in the editor


Now you have a fully functioning layered character that works just as a normal non-layered character. We can even apply skins directly to each layer by modifying the target layer that the skin asset points to.

Note:
ℹ️ When adding skins to layers, remember that Layer 0 is your main render component, and Layer 1 and forward are your composite components, so in this case we're applying a skin to the "Lower" body part.