Traverse Link¶
The Traverse Link allows characters to execute one-off animations that displace them from their current destination to the desired one.
Component¶
The Traverse Link component is divided into multiple sections that allow customizing its individual behavior.
The Motion field must reference a Motion Link asset, which contains the shared logic between this obstacle and others of the same type.
The Actions field is an optional reference to a Motion Actions asset, which allows a character to perform one or multiple actions while traversing the current Traverse Link.
Example of a Motion Actions in a Traverse Link
Canceling vaulting over an object into a dash.
The Force Grounded boolean will enforce the character to detect itself as being grounded, so the animations from the animation States are the grounded ones, instead of the airborne.
When to use Force Grounded
It is recommended that the Force Grounded toggle is used when the Gravity field of the Motion Link is set to zero. When characters have no gravity, even being close to the ground might report false positives, due to floating point precision errors.
The Parent To Transform field is optional and will temporarily parent the character onto the specified Transform component. Upon exiting the Traverse Link, the character will automatically re-parent itself back to its previous one (if any).
When to use Parent To
It is recommended to leave the Parent To field empty unless the motion uses an animation State and the Traverse Link component moves while the character is traversing it.
This is because characters detect motion relative to their parent. So for example, if a Traverse Link is moving towards the right while the character is traversing it, the character will understand itself is moving to the right and play the corresponding animation.
Parenting the character to the Traverse Link will avoid that.
The Type dropdown has a set of options that change how characters approach the obstacle when traversing it.
- Point to Point: The character snaps to the start position and rotation and moves to an end position and rotation. The width of the obstacle can also be specified. Use this when you know the start and end positions in advance.
- Slide and Stick on Line: The character snaps at the closest position within the bounds of a line defined by two points. Use this if you want the character to traverse a line and allow it to start mid-way. For example, a Zipline.
- Slide and Stick on Surface: The character snaps at the closest point within the bounds of a plane. Use this if you want the character to traverse a surface and allow it to start mid-way. For example, sliding down a steep hill.
- Warp to Target: The character starts from its current position and moves towards the specified point in space. If no rotation is provided, it will use the default character rotation. Use this if the starting position is the character itself, like when using a grappling-hook.
The Ignore Colliders is a list of all the colliders that the character will ignore when traversing the obstacle. This is especially useful when characters need to phase through a collider in order to reach the other side.
Characters use a combination of motion warping and root motion when traversing, but in both cases the physics collisions are respected and a character won't penetrate other colliders. Temporarily ignoring certain colliders allows characters to perform certain animations more easily.
Example of Ignore Colliders
When a character vaults over a fence, the character itself will phase through the fence, while the animation makes it appear like the character jumps over it. In this case, it's easier to make the character ignore the fence collider, instead of modifying the character's Capsule Collider height so it goes above the fence when moving.
The Continue To field allows to automatically chain another Traverse component after finishing the current one.
This allows characters to execute multiple parkour movements in succession without the need to manually trigger them.
Canceling a Traverse Link
Note that if a Motion Actions asset early-cancels the current Traverse Link or a Cancel Traverse Link instruction is executed before the current traverse finishes, the Continue To won't execute.
The On Enter and On Exit instructions are executed whenever a character starts and finishes traversing the Traverse Link component. This is especially useful to play visual and sound effects.
Self and Target
Note that whenever the On Enter or the On Exit instructions are called, the Self value will reference the Traverse Link game object and Target the character executing the movement.
Using a Traverse Link¶
To traverse a Traverse Link obstacle use the Traverse Link instruction, which accepts a Character and a Traverse Link. The Wait Until Finish checkbox determines whether the instruction is put on hold until the character has finished executing the movement, or it is canceled.
Accepting multiple Traverse Links
The Traverse Link field by default accepts a game object, and not a Traverse Link component. This is because instead of executing the component attached, it searches through all the child objects for other Traverse Link components and executes the first one that fulfills the Can Run condition.
This is especially useful if you have multiple types of characters, and some may play a different Traverse Link depending on their class or type.
You can also use the Can Run conditions in the Motion Link to determine whether a character should slide down or crawl a small hole on a wall, depending on the character's current speed.
Alternatively you can use the Traverse Link (Bi-Direction) which accepts two Traverse Link references: One for when the character is more or less looking at a certain direction, and another one for when it is looking at the opposite direction.
When to use Traverse Link Bi-Direction
This instruction is very useful for Traverse Links that allow characters to go in both directions. For example, a wall-run will usually allow characters to move both ways, and the direction at which the character moves is determined by the direction it is moving towards when attempting to traverse the wall.