Add an overlay state¶
An overlay state is an Anim Blueprint that provides a pose for the overlay layer. This tutorial covers three cases:
- Look at the Injured stance (a complete stance overlay that ships with the plugin): the quickest way to learn the pose Anim Blueprint.
- Add a new stance to the overlay pose menu (for example Wounded Arm).
- Add a body style to the overlay body menu.
For an item pose (something held, spawned by the equipment system), see Add an equipment item; the pose Anim Blueprint part is the same as here.
Background: Overlay system.
The pose Anim Blueprint in short¶
Every pose overlay is a child of ABP_OverlayPose_Base with only class defaults set:
- Pose variables (
Stand_Relax_Idle,Stand_Ready_Walk,Crouch_Aim_Move...): each an animation plus a curve map. - Can Aim: whether the Ready and Aiming states are used.
- Aim sweeps (
Stand_Aim_Sweep,Crouch_Aim_Sweep) for items that aim. - Aim Sweep Interp Speed Local / Remote: 30 / 10.
Poses are usually single-frame animations of the upper body holding the pose. The curve map says which body parts take the pose (see Curves).
1. Look at the Injured stance¶
ABP_Overlay_Injured (one hand held to the side) and ABP_Overlay_HandsTied (hands behind the back) are complete stance overlays. Open one to see how a stance is set up:
- Open
/GASPALS/Systems/OverlaySystem/OverlayPose/Injured/ABP_Overlay_Injuredand go to Class Defaults. - Under GASPALS > Overlay > Poses > Stand, Stand Relax Idle has its Overlay Pose set to
Pose_Injured_Stand, and so do Stand Relax Walk, Stand Relax Run and Stand Relax Sprint (one pose can serve every speed). - Under Poses > Crouch, Crouch Relax Idle and Crouch Relax Move use
Pose_Injured_Crouch. -
Each Curve Map uses the same values as the Box poses in
ABP_Overlay_Box. For a stance of your own that takes the whole upper body, start with:Curve Value layering_spine1 layering_head1 layering_arm_l,layering_arm_r1 layering_hand_l,layering_hand_r1 layering_arm_l_ls,layering_arm_r_ls1 layering_pelvis,layering_legs0 (keep the locomotion legs) or up to 1 for a limp layering_spine_add,layering_head_add,layering_arm_l_add,layering_arm_r_add0.5 (keep some motion) The quickest way: copy the curve map from a Box pose in
ABP_Overlay_Box(right-click the field > Copy, then Paste on yours) and adjust. 5. Can Aim is off: the stance never goes to Ready or Aiming. 6.ABP_Overlay_HandsTiedis set up the same way withPose_HandsTied_*. 7. Test: Play, hold V, pick Injured. Walk, run, crouch. To experiment, adjust the curves: lowerlayering_spine_addto make the torso stiffer, raiselayering_legsto bring the pose's legs in.
Pick stances after spawn
Setting Overlay Pose on the pawn's AC_OverlaySystem does not show the stance at spawn: the equipment system links its own pose afterwards. Use the menu, or call Select|NewOverlayPose on the component after spawn.
2. Add a new stance¶
- Animations. Author the stance poses (standing and crouched) on the UEFN mannequin (
/GASPALS/Characters/UEFN_Mannequin/Meshes/SK_UEFN_Mannequin), or author them on your own skeleton and retarget them to the UEFN mannequin with an IK Retargeter (Export Animations in the retargeter). Single-frame animations are enough. - Anim Blueprint. Duplicate
ABP_Overlay_Injured(a complete example, see step 1) into a new folder, for exampleOverlayPose/WoundedArm/ABP_Overlay_WoundedArm, and set your poses and curves. - Enum. Open
/GASPALS/Systems/OverlaySystem/OverlayPose/Enum_OverlayPoseand add an enumerator,WoundedArm. The menu picks it up automatically. - Link it. Open
AC_OverlaySystem, functionUpdateOverlayPose. It switches on the enum and links one class per case. Add a pin forWoundedArmand connect it to a Link Anim Class Layers node onParentMeshwithABP_Overlay_WoundedArm, like the other cases. Compile and save. - Test on both pawns (N), with a listen server client.
Stances and items share the layer
A stance from the overlay menu and an item from the equipment menu both link the same overlay pose layer, and the last one wins. If a stance must combine with items (an injured character holding a pistol), make it an item pose instead: an equipment data asset with the stance poses.
3. Add a body style¶
- Duplicate
/GASPALS/Systems/OverlaySystem/OverlayBody/Feminine/ABP_OverlayBody_Feminineand name it, for example,ABP_OverlayBody_Heavy. - In its class defaults, set Pose Stand Idle, Pose Stand Move, Pose Crouch Idle and Pose Crouch Move.
- Add an enumerator to
OverlayBody/Enum_OverlayBody. - In
AC_OverlaySystem.UpdateOverlayBody, add the case and link your class, like the existing cases. - Test with B.
Tips¶
- Ready and aim poses for items: hold the weapon raised (Ready) and at the eye (Aim). Set Can Aim on. The state machine uses Ready after aiming and drops to Relaxed after a few seconds.
- Hand IK: set
enable_handik_l(or_r) to 1 in the poses where the support hand holds the item, and add aHandIKsocket on the item. - New settings on the base: if you add a variable to
ABP_OverlayPose_Base, existing children keep their own class defaults (empty or 0). Set the value on every child. - Authoring curves in animations instead of curve maps: apply the
Create_LayeringCurvesanimation modifier (OverlaySystem/AnimModifiers) to your pose animations and edit the keys.