MoveTowards
Moves a point current towards target.
Read time 1 minuteLast updated 5 days ago
Definition
- Type: Method
- Namespace: UnityEngine
- Assembly: UnityEngine.CoreModule
MoveTowards(Vector4, Vector4, float)
Moves a point towards .
currenttargetpublic static Vector4 MoveTowards(Vector4 current, Vector4 target, float maxDistanceDelta)
Parameters
Returns
Type | Description |
|---|---|
| Vector4 | The new position, moved from |
Remarks
This is essentially the same as Vector4.Lerp but instead the method ensures that the distance moved never exceeds . Negative values of pushes the vector away from .
maxDistanceDeltamaxDistanceDeltatargetMoveTowards(Vector4, Vector4, float)
Moves a point towards .
currenttargetpublic static Vector4 MoveTowards(in Vector4 current, in Vector4 target, float maxDistanceDelta)
Parameters
Returns
Type | Description |
|---|---|
| Vector4 | The new position, moved from |
Remarks
This is essentially the same as Vector4.Lerp but instead the method ensures that the distance moved never exceeds . Negative values of pushes the vector away from .
maxDistanceDeltamaxDistanceDeltatarget