Skip to content

Set up cover in a level

The cover system needs no special actors: it finds cover with traces against the level geometry. This page lists what the geometry needs so every cover feature works, and how to test a level.

Requirements at a glance

Feature The level needs
Taking cover Walls whose collision blocks the Visibility channel (the default for static meshes).
Low vs. high cover Walls lower than about 1.45 m are low cover (the check is High Cover Height, 60 cm, above the capsule center).
Cover run A NavMeshBoundsVolume covering the play area, with the navmesh built.
Vault from cover The cover must block the Traversable channel (see Make objects traversable).
Corner turn At least Corner Turn Min Width (50 cm) of wall around the corner.
Aim around an edge Free space past the wall end: capsule radius plus Cover Aim Edge Clearance (20 cm).
Pose lowering Walls at least 10 cm thick, so the down trace from the top finds them.

1. Block out the cover

Any static mesh works. The demo levels use LevelBlock and LevelBlock_Traversable from /GASPALS/Levels/LevelPrototyping, which you can place and scale directly.

Good cover heights for the sample characters (180 cm tall, capsule center about 86 cm above the floor):

Height Plays as
90 to 110 cm Low cover: the character crouches behind it, can aim over it, can vault it.
110 to 140 cm Low cover, but the character barely clears it when standing to aim.
150 cm and more High cover: the character stands; aiming steps out at the wall ends.

Leave at least a capsule width (about 80 cm) of floor along the cover so the character can move along it.

2. Check the collision

Select a wall and look at Collision Presets in its Details panel. BlockAll, BlockAllDynamic and TraversalObjectPreset all block Visibility. Avoid InvisibleWall (ignores Visibility) and simple collision that does not match the visible shape: the character hugs the collision, not the mesh.

Type show collision in the console during Play to see what the traces hit.

3. Add navigation for cover runs

The cover run follows a navmesh path to the target cover.

  1. Place Actors > Volumes > Nav Mesh Bounds Volume, and scale it over the whole play area.
  2. Press P in the viewport to show the navmesh. It must reach the floor in front of the cover.
  3. Keep Project Settings > Navigation System > Allow Client Side Navigation on for multiplayer (the template sets it).

Without a navmesh the character runs to the cover in a straight line, and stops at the first obstacle.

4. Make cover vaultable

Pressing jump in cover vaults over it through the traversal system. Traversal only considers geometry that blocks the Traversable trace channel. Use LevelBlock_Traversable, set the wall's collision preset to TraversalObjectPreset, or set its Traversable response to Block in a custom preset. Walls that do not block it make the character jump instead.

5. Test

  1. Play and walk into a wall: the character takes soft cover and turns along it.
  2. Aim at a wall a few meters away and tap Q: the cover marker shows on the wall and the character snaps to it.
  3. Aim at a wall farther away and hold Q: the character runs there.
  4. In sticky cover, hold the move input toward a wall end: the character stops at the end, and turns around an outside corner.
  5. Behind low cover, aim (Right Button) over the wall: the character stands up; aim along the wall: it stays down.
  6. Press Space in front of low cover: the character vaults.

For debugging, turn on Cover Aim Debug on the pawn's cover component to print aim pose changes, and use show collision and the navmesh view (P).

Common problems

Symptom Cause
The character never takes cover The wall ignores Visibility, or Enable Cover is off on the pawn's cover component.
Cover drops when moving along a long wall The wall is made of pieces with gaps or uneven faces. Close the gaps, or raise Max Cover Turn Angle for bends.
The cover run goes straight into an obstacle No navmesh, or the navmesh does not reach the target.
Jump in cover jumps instead of vaulting The cover does not block Traversable, or it is too high to vault.
The character sinks into low cover The cover top is lower than the head clearance assumes; lower Cover Lower Max Crouch.

More settings are in Configure cover behavior.