Transform List Get Closest
Finds the closest Transform in a Transform List to a target Transform.
Parameters
| Parameter | Description |
|---|---|
| Transforms | The Transform List to search. |
| Target | The Transform to measure distances from. |
| Axis | The axis used for distance measurement, such as XY, XZ, or XYZ. |
| Store Result | Stores the closest Transform. |
| Store Index | Stores the zero-based index of the closest Transform. |
| Store Distance | Stores the distance to the closest Transform. |
| Found | Stores true if a valid Transform was found. |
Notes
- Null entries in the list are ignored.
- If the list is empty, the target is missing, or no valid entry is found, outputs are reset and
Foundstaysfalse. - At least one output should be assigned, otherwise the action reports an error in the editor.
- Axis filtering makes it easy to find the closest target in 2D or top-down setups without considering the unused axis.
Example
Use this action to choose the nearest enemy from a list of possible targets, then store both the Transform and the distance for follow-up aim or attack logic.