Skip to content

Cover system

The cover system lets a character take cover against walls and low obstacles, move along them, run from cover to cover, turn around corners, vault over cover and aim from it. It works on both sample pawns and in multiplayer.

Folder /GASPALS/Systems/CoverSystem
Components AC_CoverSystem_Base (core), AC_CoverSystem_Mover or AC_CoverSystem_CMC (adapter). Both sample pawns name it AC_CoverSystem.
Mover assets BP_MovementMode_Cover, BP_MovementTransition_Cover, input struct S_MoverCustomInputs_Cover
Animation CR_Humanoid_CoverLower at the end of both character Anim Blueprints
Widgets W_CoverMarker (cover marker), crosshair tint in W_Crosshair
Input IA_Cover (sticky cover and cover run), plus the regular move, crouch, aim and jump inputs
Level needs Walls the traces can hit; a NavMeshBoundsVolume for cover runs around obstacles
Settings Cover reference

Kinds of cover

Walk into a wall and the character takes cover. It is kept while the character stays close to the wall and is left by moving away from it. Corners and wall ends release soft cover, unless the camera still looks at a wall.

Soft cover is what most "walk up to a wall and hug it" games do. Turn it off with Enable Auto Cover.

Press the cover button (IA_Cover) and the character snaps to the wall under the crosshair. Sticky cover pulls the character to the wall, always stops at wall ends, allows corner turns, and is only left deliberately: a quick tap of the cover button, a firm push away from the wall, a cover run, a vault or aiming out of it.

Pressing the button in soft cover upgrades it to sticky cover. Turn the button off with Enable Sticky Cover.

A wall that does not reach High Cover Height (60 cm above the character origin) is low cover. The character crouches behind it (Auto Crouch Low Cover), the camera rises over it, and aiming can stand up over it. A standing character takes low cover only through sticky cover or by crouching in front of it, and standing up leaves soft low cover.

What the player can do

Action Input (demo) Result
Take soft cover Move into a wall The character turns to its cover facing and moves along the wall.
Take sticky cover Tap Q (IA_Cover) Snaps to the wall under the crosshair, within Sticky Cover Reach (250 cm).
Leave sticky cover Tap Q again, or push away from the wall A tap must be shorter than Sticky Tap Time (0.25 s).
Cover run Hold Q while aiming at farther cover Sprints to the cover under the crosshair, up to Cover Run Range (15 m), and takes sticky cover there. Releasing the button cancels the run.
Move along cover Move left or right Stops at wall ends (sticky always, soft with Stop At Edges).
Turn a corner Hold toward the wall end in sticky cover After Corner Turn Hold Time (0.3 s) the character moves around the corner if a side wall is there. Chained corners keep following the wall.
Crouch C Crouches. Behind low cover the character crouches by itself.
Vault Space Turns to the wall if needed, then vaults over it with the traversal system.
Aim from cover Hold Right Button Picks the least exposed pose that can hit the target (see below).

The cover marker (a widget on the targeted wall) and a green crosshair show where the cover button will take the character.

How it works

The core component evaluates cover every frame on the owning machine, then hands the result to the movement back end.

flowchart LR
    Input[Move input<br>camera, cover button] --> Eval[EvaluateCover<br>AC_CoverSystem_Base]
    Eval -->|Mover| MoverIn[S_MoverCustomInputs_Cover<br>in the Mover input]
    MoverIn --> Mode[BP_MovementMode_Cover<br>along-wall movement, wall spring]
    Eval -->|CMC| Shape[ShapeCoverMoveInput<br>shaped acceleration]
    Shape --> CMC[Character Movement Component]
    Eval --> Facing[GetCoverOrientationIntent<br>facing]
    Eval --> Cam[GetCoverCameraState<br>camera director offsets]
    Eval --> Pose[GetCoverLowerAmount<br>CR_Humanoid_CoverLower]
  1. Sensing. Sphere traces (Cover Trace Radius) in the move direction find a wall within Cover Enter Distance. A second trace at High Cover Height decides high or low cover. Probes at Edge Probe Offset to each side find the wall ends and corners.
  2. Deciding. The move input must point into the wall (Cover Enter Input Dot). Cover is kept while the wall is within Cover Hold Distance, and left after the input points away from it (Cover Exit Input Dot) for Cover Exit Delay.
  3. Moving. In cover, the move input is turned into movement along the wall, and a spring holds the capsule at the Wall Distance gap for the current case (stand or crouch, soft or sticky).
    • Mover: the cover data travels in the Mover input (S_MoverCustomInputs_Cover). BP_MovementTransition_Cover switches between Walking and the Cover mode; BP_MovementMode_Cover moves along the wall (walk 150 cm/s, run and sprint 250 cm/s) and runs the wall spring.
    • CMC: AC_CoverSystem_CMC shapes the acceleration before the Character Movement Component runs, and turns the mesh to the cover facing.
  4. Facing. Four settings pick the facing per case: FaceWall, ShoulderToWall (along the wall, in the move direction) or BackToWall.
  5. Camera. The camera director reads GetCoverCameraState: it raises the camera behind low cover (CameraRig_TP_Offset_CoverLow), offsets it at wall ends (CameraRig_TP_Offset_CoverEdgeLeft/Right) and swaps the shoulder toward the open side.
  6. Pose. CR_Humanoid_CoverLower lowers the pelvis so the head stays under the cover top, and plants the legs on the animated feet.

Features in detail

Cover run

Hold the cover button while the crosshair is on cover beyond Sticky Cover Reach. The character sprints along a navigation path to a stand point 60 cm in front of the wall, slows down for the arrival (Cover Run Arrive Speed, Cover Run Brake Decel) and snaps into sticky cover at Cover Run Arrive Distance. Released button, blocked path or a time limit (path length at 5 m/s plus Cover Run Max Time) cancel the run.

The path comes from the navigation mesh (FindPathToLocationSynchronously). Without a navmesh, or when no path is found, the character runs in a straight line and can get blocked. Clients build their own path, which needs bAllowClientSideNavigation=True in the project settings.

Corner turn

In sticky cover, hold the move input toward a wall end. If the wall continues around the corner (an outside corner up to Corner Turn Angle, 100 degrees between the two wall normals, with at least Corner Turn Min Width of wall), the character walks around it and stays in cover. The held input keeps working after the turn, so a round pillar or a run of corners is followed in one go.

Vault from cover

Jump in cover asks for a vault (RequestCoverVault). If the character does not face the wall within Vault Facing Dot, it turns first (up to Vault Facing Timeout). The component then fires the OnCoverVaultReady dispatcher; the pawn handles it and starts the traversal. If the traversal finds nothing to vault, the Mover pawn falls back to a jump.

Aim from cover

With Enable Cover Aim on (default), aiming in cover does not leave cover. The character takes the least exposed pose that can hit what the camera aims at, faces the aim direction, and walks back to its cover spot when aim is released.

Pose Meaning Exposure
InPlace Stay at the cover spot (crouched behind low cover). Lowest
EdgeLeft, EdgeRight Step out past the end of the wall. Medium
Over Stand up behind low cover. Highest

The order is: in place, then the edge the aim points toward, then the other edge, then over. A pose "can hit" when a line from its muzzle position (Cover Aim Muzzle Height Stand/Crouch) reaches the target. The target is found along the camera direction from standing eye height above the cover spot, so the choice does not chase the camera as it moves with the pose. Aiming at your own cover counts as aiming past it.

Switching is damped so the pose does not flicker: a more exposed pose is taken only after the current one has been blocked for Cover Aim Blocked Delay, and a safer pose is taken back only after it has been clearly valid for Cover Aim Return Delay. With Cover Aim Keep Standing (default), a character standing over low cover only crouches back down, never side-steps to an edge.

While aiming, pushing away from the wall leaves cover and keeps aiming. Lateral input is ignored. The camera drops its low-cover offset and takes the shoulder of the side the character stepped out to. Turn on Cover Aim Debug to print every pose change and draw the target.

Pose lowering

CR_Humanoid_CoverLower runs at the end of SandboxCharacter_Mover_ABP and SandboxCharacter_CMC_ABP. It measures the cover top with a trace down into the wall and lowers the pelvis until the capsule top is Cover Lower Head Clearance (5 cm) under it, clamped to Cover Lower Max Stand (10 cm) or Cover Lower Max Crouch (15 cm). Behind cover taller than the character it lowers nothing, and it does not lower while standing over low cover to aim. The amount is computed on every machine from the replicated cover state, so remote players look the same.

The rig uses the UEFN mannequin bone names (pelvis, thigh_l, calf_l, foot_l...). Retargeted characters get it through the animation skeleton.

First person in cover

Setting Options
First Person Sticky Cover SwitchToThirdPerson (default): sticky cover switches the camera to third person and back when it ends. Disabled: the cover button does nothing in first person.
First Person Auto Cover MovementOnly (default): walking into a wall gives cover movement (wall hug, edges), but the body follows the camera instead of the cover facing. Disabled: no auto cover in first person.

Cover marker

With Show Cover Marker on, the local player sees W_CoverMarker on the cover under the crosshair, and the crosshair turns green. The marker is a widget component the system creates on demand; restyle it by editing W_CoverMarker.

Configuration

All settings are on the cover component of the pawn. Select AC_CoverSystem in the pawn's Components panel and look under GASPALS > Cover in the Details panel. The categories are:

Category Controls
General Master switches: Enable Cover, Enable Auto Cover, Enable Sticky Cover, Engage Rule (Automatic or WhileCrouched), Move Into Cover, Auto Crouch Low Cover.
Detection Trace distances, radius, low/high cover height, edge probes, how sharp a bend cover follows.
Movement Wall gaps per case, the wall spring, pull and push speeds, stopping at edges in soft cover.
Facing Facing style per case, shoulder yaw offsets (and on the CMC adapter, the mesh turn speed).
Exit How firmly and how long to push away to leave soft and sticky cover.
Sticky Cover button reach and tap time.
CoverRun Range, time limit, path following and arrival.
CornerTurn Hold time, corner angle and width.
Traversal Facing needed before a vault, and its timeout.
Aim Aim from cover: switch, muzzle heights, damping, edge clearance, debug.
Pose Pelvis lowering limits and head clearance.
FirstPerson Behavior when the camera is in first person.
Marker Cover marker on or off.
Mover / CMC Adapter settings: the Mover's cover and ground mode names; the CMC's forced crouch delay and mesh turn speed.

Every setting with its default is in the Cover reference. Recipes for common setups (no auto cover, Gears-style sticky only, crouch-only cover, wider wall gaps) are in Configure cover behavior.

Check settings on the pawn's component

Enable Cover and Auto Crouch Low Cover are on by default, so adding a cover component to your own pawn enables cover without further setup; the sample pawns also set them on their components. Check settings on the pawn's component rather than on the class: a value changed in AC_CoverSystem_Base does not reach pawns that already set their own.

Networking

  • Mover pawn. The cover state is part of the Mover input, so the server and the other clients run the same cover movement as the owner. Simulated proxies get it through the synced inputs. No extra replication is needed.
  • CMC pawn. The owner shapes its own acceleration (replicated by the CMC). The cover state is sent to the server about 20 times a second (ServerUpdateCover) and replicated to other machines, which apply it in ApplyRemoteCoverState. Small corrections (2 to 4 cm) can happen at sticky edge stops and corners.
  • Aim from cover runs on the owner only. Other machines see its result: position, crouch and facing.
  • Cover run paths are built on each client, so bAllowClientSideNavigation must be on.

Using cover from Blueprints

Call On Use
RequestStickyCover / ReleaseStickyCover Base Cover button pressed / released (sticky cover, tap and cover run).
EvaluateCover Base Runs the cover logic for this frame. Mover pawns call it in ProduceInput; the CMC adapter calls it from UpdateCoverCMC.
RequestCoverVault Base Ask for a vault from cover; listen to OnCoverVaultReady to start the traversal.
IsCoverAiming Base True while aiming from cover.
GetCoverCameraState Base Low cover and edge side, for your own camera logic.
GetCoverOrientationIntent Base The facing the pawn should turn to.
UpdateCoverCMC CMC adapter Call before the CMC updates (the sample pawn calls it from AC_PreCMCTick).
UpdateMoverCoverState Mover adapter Keeps the in-cover flag in step with the Cover mode, every tick.

The CMC pawn's state is also readable on any machine from the component's CoverState. To put cover on your own pawn, follow Add the systems to your own pawn.

Limitations

  • Cover needs walls the traces can hit (the Visibility channel by default). Very thin walls (under 10 cm) count as tall for the pose lowering.
  • Peek (leaning out without aiming) is not implemented.
  • The cover run runs straight when no navmesh path exists, and can then be blocked.
  • The pose-lowering rig expects the UEFN mannequin bone names.
  • In first person, only the two behaviors of the First Person settings are available.
  • The CMC pawn shows small corrections at sticky edge stops and corners in network play.