Skip to content

Add an overlay state

An overlay state is an Anim Blueprint that provides a pose for the overlay layer. This tutorial covers three cases:

  1. Look at the Injured stance (a complete stance overlay that ships with the plugin): the quickest way to learn the pose Anim Blueprint.
  2. Add a new stance to the overlay pose menu (for example Wounded Arm).
  3. 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:

  1. Open /GASPALS/Systems/OverlaySystem/OverlayPose/Injured/ABP_Overlay_Injured and go to Class Defaults.
  2. 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).
  3. Under Poses > Crouch, Crouch Relax Idle and Crouch Relax Move use Pose_Injured_Crouch.
  4. 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_spine 1
    layering_head 1
    layering_arm_l, layering_arm_r 1
    layering_hand_l, layering_hand_r 1
    layering_arm_l_ls, layering_arm_r_ls 1
    layering_pelvis, layering_legs 0 (keep the locomotion legs) or up to 1 for a limp
    layering_spine_add, layering_head_add, layering_arm_l_add, layering_arm_r_add 0.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_HandsTied is set up the same way with Pose_HandsTied_*. 7. Test: Play, hold V, pick Injured. Walk, run, crouch. To experiment, adjust the curves: lower layering_spine_add to make the torso stiffer, raise layering_legs to 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

  1. 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.
  2. Anim Blueprint. Duplicate ABP_Overlay_Injured (a complete example, see step 1) into a new folder, for example OverlayPose/WoundedArm/ABP_Overlay_WoundedArm, and set your poses and curves.
  3. Enum. Open /GASPALS/Systems/OverlaySystem/OverlayPose/Enum_OverlayPose and add an enumerator, WoundedArm. The menu picks it up automatically.
  4. Link it. Open AC_OverlaySystem, function UpdateOverlayPose. It switches on the enum and links one class per case. Add a pin for WoundedArm and connect it to a Link Anim Class Layers node on ParentMesh with ABP_Overlay_WoundedArm, like the other cases. Compile and save.
  5. 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

  1. Duplicate /GASPALS/Systems/OverlaySystem/OverlayBody/Feminine/ABP_OverlayBody_Feminine and name it, for example, ABP_OverlayBody_Heavy.
  2. In its class defaults, set Pose Stand Idle, Pose Stand Move, Pose Crouch Idle and Pose Crouch Move.
  3. Add an enumerator to OverlayBody/Enum_OverlayBody.
  4. In AC_OverlaySystem.UpdateOverlayBody, add the case and link your class, like the existing cases.
  5. 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 a HandIK socket 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_LayeringCurves animation modifier (OverlaySystem/AnimModifiers) to your pose animations and edit the keys.