Match Feature | Distance {{ currentPage ? currentPage.title : "" }}

Size: 1

Input Response Feature: Yes

Quality Feature: No


The Distance match feature uses a single float to represent the Euclidean distance between two points. In most cases it is used to compare the distance between the character and a certain point of interest (POI’s) in the future or past. These POI’s are usually things like ‘Starts’, ‘Stops’ and ‘Plants’. By predicting movement and continuously comparing the distance to these POI’s in the motion database, we can achieve more responsive movements for characters. This is particularly useful when using capsule based movement with motion matching as the prediction of the POI’s comes from the movement component itself. This is similar to traditional distance matching, except, instead of using the distance to directly control the animation, it is simply being used as a metric in the motion matching cost function.

Distance matching is recommended to be used alongside a trajectory response type match feature to suplement it and not alone.

Note: You will need multiple ‘Distance’ match features for different types of POI’s (e.g. one for each of ‘Starts’, ‘Stops’ and ‘Plants’.

Tagging Distance Matching POI’s for Pre-Processing

This match feature requires some manual tagging to ensure that POI’s are pre-processed correctly. These tags should be added in the ‘Motion Data’ asset on the animation timeline. Use the ‘Tag Distance Marker’ type and place it at the POI, configuring settings of the type based on the type of movement as shown below:

As seen in the above image, the selected distance marker tag is setup for a ‘start’ type motion. The Tag is positioned exactly at the point in time where the character begins to perform the start movement. For something like a stop, the POI should be placed at the point in time where the character stops moving and goes into an idle pose. For ‘Plants’, the marker should be placed at the turning point of the plant, where the direction of the character starts changing.

Settings for the tags are described as follows:

Distance Match Trigger - The type of movement this distance marker is related to. This is purely so the system can separate movement types and not confuse the data. For example, you wouldn’t want to mistake a locomotion start motion for a ‘start jump’ motion.

Distance Match Type - Which direction (in time) that the distance is measured to the POI. For example, with start motions, the distance is measured backward in time toward the starting point where the character is idle. Inversely, for stop motions the distance is measured forward in time to the stopping point. Plants on the other hand are a combination of a stop followed by a start and therefore, both is appropriate:

  • Backward - Distance is measured backward in time towards the POI (typically used for starts)

  • Forward - Distance is measured forward in time towards the POI (typically used for stops)

  • Both - Distance is measured both forward and backward towards the POI depending on the part of the motion currently being enacted (typically used for plants).

Distance Match Basis - The basis of how the distance is to be measured:

  • Positional - Euclidean distance is measured between the character’s position and the position of the POI.

  • Rotational - The distance is measured as a yaw angle between the character’s yaw and the that of the POI. This is used less commonly but can be used for things like turning in place.

Note: Distance Marker tags will only affect ‘match features’ that have the exact same settings for ‘trigger’, ‘type’ and ‘basis’.


The settings of the Distance Match Feature are as follows:

Default Weight: The default weighting for this distance match feature. This generally needs to be quite high to have a significant impact. However, be aware that setting it too high may cause animation quality to degrade.

Distance Match Trigger - See above section for details.

Distance Match Type - See above section for details.

Distance Match Basis - See above section for details.

Note: The ‘Distance Match’ settings will determine which distance match tags this ‘match feature’ will interact with.

Data Layout

The ‘Distance’ match feature consists of a single float representing the Euclidean distance to a given motion metric. The metric in question is dependent on the settings of the match feature. The data is laid out as follows:

|| Distance ||

Runtime Input Extraction

As this match feature is related to ‘input response’ you will need to generate the distance data at runtime based on user input. This is typically done by using the ‘Distance Matching Component’ on your character and using helper functions to populate a float array. However, advanced users that understand the layout of motion matching data with ‘Motion Symphony’ can populate the input array any way they like (even manually if they desire).

For more information, please see the section of the documentation on ‘Distance Matching’.

{{{ content }}}