Make objects traversable¶
Traversal only considers geometry that blocks the Traversable trace channel. Everything else is jumped. Background: Traversal system.
Before you start
The Traversable channel and the TraversalObjectPreset profile come from the project's collision settings. In a project of your own, add them first: see Project settings.
Option 1: use the grey-box block¶
Place /GASPALS/Levels/LevelPrototyping/LevelBlock_Traversable and scale it. It is already set up, and is what the demo levels use.
Option 2: set the collision preset¶
- Select the static mesh actor in the level (or the mesh component in a Blueprint).
- In the Details panel, under Collision, set Collision Presets to TraversalObjectPreset.
The preset blocks everything, including Traversable.
Option 3: custom collision¶
Use this to keep your object's other collision responses:
- Under Collision, set Collision Presets to Custom.... The responses of the previous preset are kept as the starting point.
- Under Trace Responses, set Traversable to Block.
To make every placement of a mesh traversable, do this in the static mesh asset itself (Static Mesh Editor, Details panel, Collision section) instead of on each actor. For Blueprint actors, set it on the mesh components in the Blueprint.
Shapes that work¶
| Obstacle | Typical result |
|---|---|
| Low and thin (a fence, a low wall) | Hurdle or vault, depending on speed and what is behind it. |
| Low and deep (a crate, a table) | Vault or mantle up onto it. |
| Chest height | Mantle. |
| Taller than the character can reach | Jump. |
| Narrower than 70 cm | Jump (Min Ledge Width on AC_TraversalTracer). |
Simple collision that matches the visible top edge gives the best results: the warp targets are placed on the measured ledge. The character also needs room: the space on top of the obstacle (and behind it, for a vault or hurdle) must be free of anything that blocks Visibility.
Test it¶
- Press Play, run at the obstacle and press Space (gamepad A). The character vaults, hurdles or mantles instead of jumping.
- Try it on both pawns (Mover and CMC), walking, running and standing in front of it.
Debug¶
- Type
DDCvar.Traversal.DrawDebugLevel 3in the console during Play, then jump at the obstacle: the traces, ledges and room checks are drawn and the measured data is printed.DDCvar.Traversal.DrawDebugDurationsets how long the shapes stay. - Drop a
BP_TraversalTester(/GASPALS/Systems/TraversalSystem) in front of the obstacle in the editor, its forward (X) arrow toward it: it draws the ledges the tracer finds without playing. Its Initial Trace Distance (600) sets how far it looks. It finds the obstacle with the Pawn collision profile, not the Traversable channel, so use step 1 to check the channel. show collisionshows whether the obstacle's collision is what you expect.
| Symptom | Fix |
|---|---|
| The character always jumps | The obstacle does not block Traversable, or it is narrower than Min Ledge Width. If no obstacle traverses at all, check that the project has the Traversable channel and that Traversable Trace Channel on AC_TraversalLogic names it. |
| The hands or feet miss the edge | The collision top is not where the visible edge is. |
| The character jumps although the obstacle blocks Traversable | Something that blocks Visibility is in the way on top of or behind the obstacle (the room checks failed), or no chooser row matches the obstacle's height and depth. |
| A traversal plays into a wall behind the obstacle | The room check found space; add collision for the wall, or block Visibility on it. |