CVR Distance Constrain
Constrains the position of an object relative to a target transform within a minimum and maximum distance range.
Fields
Section titled “Fields”| Name | Type | Description |
|---|---|---|
target | Transform | The target transform to measure distance from. |
minDistance | float | The minimum distance the object must stay from the target. |
maxDistance | float | The maximum distance the object can be from the target. |
- If
minDistanceormaxDistanceis0, that bound is treated as unbounded (only the other bound is enforced). - Gizmos are drawn in the Scene View to visualize the constrained range when the component is selected.
- Distance constraints are applied during both
UpdateandLateUpdate, so animations and post-animation transform changes are both clamped.
Source
Section titled “Source”CVR-GameFiles/ABI.CCK.Components/CVRDistanceConstrain.cs