Traversal system¶
Traversal moves the character over obstacles: vault (over and land on the other side), hurdle (over and keep running), mantle (climb up onto). It is the Game Animation Sample traversal, shared by both pawns and triggered by jump and by vaulting from cover.
| Folder | /GASPALS/Systems/TraversalSystem |
| Components | AC_TraversalLogic (orchestration), AC_TraversalTracer (ledge measurement) |
| Preview actor | BP_TraversalTester |
| Choosers | /GASPALS/Characters/UEFN_Mannequin/Animations/Traversal/CHT_TraversalMontages_Mover, _CMC |
| Montages | Traversal/Vault, Hurdle, Mantle, Climb, Catch folders |
| Collision | The Traversable trace channel |
| Input | Space / gamepad A (IA_Jump) |
| Settings | Traversal reference |
How a traversal happens¶
flowchart LR
J[Jump pressed] --> CV{In cover?}
CV -->|facing away| Turn[Turn to the wall] --> T
CV -->|no| T[TryTraversalAction]
T --> Tr[Capsule trace<br>Traversable channel]
Tr --> L[Measure ledges<br>AC_TraversalTracer]
L --> R[Room checks]
R --> C[Chooser picks montage]
C --> P[Play montage<br>with motion warping]
T -->|nothing found| Jmp[Normal jump] - Trigger. Jump calls
TryTraversalActionwith inputs from the pawn'sGetTraversalCheckInputs: a trace forward whose length grows with speed (on the ground) or a short trace (in the air), sized by the Check settings below. In cover, the cover system first turns the character to the wall (RequestCoverVault). Held jump keeps retrying every frame. - Find the obstacle. A capsule trace on the Traversable Trace Channel (the Traversable channel). No hit: the pawn jumps instead (crouched on the Mover pawn: it stands up).
- Measure it.
AC_TraversalTracerfinds the front ledge, checks the width (Min Ledge Width, 70 cm), and finds the back ledge and the floor behind. - Room checks. Capsule traces on the Room Check Trace Channel (Visibility) check the character fits on top of the front ledge and between the ledges. They give the obstacle height and depth, and whether there is a back ledge and a back floor.
- Pick the montage. The chooser (
CHT_TraversalMontages_Moveror_CMC) gets the action type, ledge data, height, depth, distance, movement mode, gait, speed and the pose history, and returns a montage with a start time and play rate. No match: the pawn jumps. - Play it. The montage plays with motion warping targets
FrontLedge,BackLedgeandBackFloor, so the animation lands exactly on the measured ledges. During the montage the character ignores the obstacle's collision and moves in flying mode; afterwards it returns to falling (vault) or walking.
Mover and CMC¶
| Mover pawn | CMC pawn | |
|---|---|---|
| Montage playback | Mover's montage support (root motion through the movement modes) | Anim instance montage with root motion |
| Movement mode during the move | Flying (queued) | MOVE_Flying |
| Replication behavior | Prediction handles it | Client-authoritative position during the move |
| Can traverse when | On the ground or in the air, no montage playing, not already traversing | Not already traversing |
| Jump while another montage plays | Nothing happens (no jump either) | Traversal or jump as usual |
The component class selects the chooser, the montage playback and the movement mode path: use AC_TraversalLogic_Mover on a Mover pawn and AC_TraversalLogic_CMC on a Character pawn (both samples name the component AC_TraversalLogic). Each class holds its own chooser table, so a build with one side does not contain the other side's montages. The plain AC_TraversalLogic picks no montage. The class also decides the replication behavior: AC_TraversalLogic_CMC makes the position client-authoritative during the move, AC_TraversalLogic_Mover leaves it to Mover's prediction.
Networking¶
The owner predicts: it runs the checks and plays the montage at once, then sends the result to the server (PerformTraversalAction_Server, reliable). The server plays it too, except for a pawn it controls locally (a listen-server host, a standalone player or a server AI), which already started the move itself, so every traversal starts once. Other machines see the montage through the movement component's montage replication. AC_TraversalLogic has Component Replicates on in both sample pawns.
Debugging¶
| Tool | Shows |
|---|---|
DDCvar.Traversal.DrawDebugLevel 1 | Ledge points |
... 2 | Plus the initial trace |
... 3 | Plus the room checks and printed ledge data |
DDCvar.Traversal.DrawDebugDuration | How long the shapes stay |
BP_TraversalTester | Place it in a level, its forward (X) arrow toward an obstacle: it draws the ledges the tracer finds, in the editor without playing. Initial Trace Distance (600) sets how far it looks. It finds the obstacle with the Pawn collision profile, not the Traversable channel, so it does not tell you whether the obstacle is traversable. |
Show Trace / Persistent Show Trace on AC_TraversalTracer | Tracer debug lines |
show collision | Whether the obstacle's collision matches what you see |
Settings¶
AC_TraversalTracer (Traversal > Tracer and Traversal > Debug):
| Setting | Default | Use |
|---|---|---|
| Min Ledge Width | 70 | Narrowest traversable ledge. |
| Min Front Ledge Depth | 37.52 | Depth of the width check into the obstacle. |
| Trace Complex | true | Trace complex collision for the ledges. |
| Show Trace / Persistent Show Trace | false | Debug drawing. |
AC_TraversalLogic (Traversal > General): Enable Traversal (true, read when play starts). Off: Space just jumps, and in cover it does nothing (the cover vault is a traversal).
AC_TraversalLogic (Traversal > Collision, set on each pawn's component):
| Setting | Default | Use |
|---|---|---|
| Traversable Trace Channel | Traversable | Channel of the obstacle search. Only geometry that blocks it can be traversed. |
| Room Check Trace Channel | Visibility | Channel of the three room checks; anything that blocks it stops the move. |
AC_TraversalLogic (Traversal > Check): the obstacle search the pawns' GetTraversalCheckInputs builds. The Mover and CMC pawns set their own speed and reach ranges, so change both when tuning.
| Setting | Default | Use |
|---|---|---|
| Traversal Check Radius | 30 | Radius of the capsule traced forward. |
| Traversal Check Half Height | 60 on the ground, 86 in the air | Half height of that capsule. |
| Traversal Check Speed Range / Traversal Check Distance Range | Mover 0 to 375 / 75 to 300; CMC 0 to 500 / 75 to 350 | On the ground the reach grows with speed: the speed range maps onto the distance range. |
| Traversal Check Air Distance / Traversal Check Air End Offset | 75 / (0, 0, 50) | Reach and end offset in the air. |
AC_TraversalLogic (Traversal > First Person): in first person the view turns toward the obstacle during a traversal, at First Person Traversal Turn Speed (2; 0 leaves the view alone), when it is more than First Person Traversal Turn Threshold (15 degrees) off.
Requirements¶
- The project defines the Traversable trace channel (and the
TraversalObjectPresetprofile): see Project settings. If your project numbers its custom channels differently, pick the channel again by name in Traversable Trace Channel (AC_TraversalLogic). - Obstacles must block the Traversable channel. See Make objects traversable.
- The pawn has an
AC_TraversalLogic, anAC_TraversalTracerand a Motion Warping component. - The pawn implements
Get_PropertiesForTraversal(BPI_SandboxCharacter_Pawn: capsule, mesh, motion warping component, movement mode, gait, speed) and has aGetTraversalCheckInputsfunction that the jump input passes toTryTraversalAction. - The montages' motion warping windows must be named
FrontLedge,BackLedgeandBackFloor.
Limitations¶
- Only geometry on the Traversable channel is considered; everything else is jumped.
- Very thin or narrow obstacles (under Min Ledge Width) are not traversed.
- What can be traversed (heights, depths, speeds) is decided by the chooser tables: an obstacle with no matching row is jumped.
- On the Mover pawn, Jump does nothing while another montage plays on the default slot or a traversal is running.