๐Animator Profiles
In this section you will learn about new layer system.
Last updated
In this section you will learn about new layer system.
Last updated
In previous versions of the FPS Animation Framework, we had a fixed amount of animation layers, specified directly in the FPSAnimator component:
The problem with this design is obvious - scalability. What if we want to add an unarmed state? Or maybe swimming? What if we want a unique animation feature for this specific weapon?
The new Scriptable Animation System eliminates this problem by introducing a dynamic linking system for animation features.
This concept is incredibly simple - animation feature encapsulation. To achieve this, the new system relies on Animator Profiles:
An Animator Profile is a Scriptable Object, that contains procedural animation features (FPSAnimatorLayerSettings). There are no limitations on how to use a profile. Whether it is a weapon, item, or a climbing state - it is possible to add custom features required for a specific gameplay scenario.
Example: imagine you want to add a ladder-climbing feature. You don't need Aiming or Recoil animation layers in this case. So you can create a new profile, which will include the features you need for this specific climbing state.
Here is how to link a new animator profile:
In this example, we dynamically link an Animator Profile from the currently equipped weapon. For items and weapons, there's a special component called FPS Animator Entity:
This is just a data component, that contains an Animator Profile and a Default Aim Point transform (the Ads Layer uses it).
A procedural animation feature consists of 2 entities:
Animation Layer Settings: a Scriptable Object that contains feature data.
Animation Layer Job: a struct that runs the procedural animation logic.
Tip: separating data and execution entities makes the workflow more convenient. We can modify the data and see the runtime changes. It is also essential for Version Control since managing data assets is quite simple.
Animation Layer Settings asset is also responsible for instantiating a new Animation Layer Job when a new Animator Profile is linked. This is how it is handled in code: