moveTowards
Moves a point current towards a target point by a maximum distance.
The input maxDistanceDeltaInput is treated as a non-negative distance; if a negative value is supplied, it's clamped to 0.0f.
If
currentis already attarget, or iftargetis within the (non-negative)maxDistanceDeltadistance, this function returnstarget.If
maxDistanceDelta(non-negative) is0.0fandcurrentis not attarget, this function returnscurrent(no movement).Otherwise,
currentis moved along the straight line towardstargetby exactlymaxDistanceDeltaunits.
Return
A new Vector2 instance representing the new position after moving.
Parameters
The starting point (Vector2).
The destination point (Vector2) towards which current is moved.
The maximum distance current should move. Negative values are treated as 0.0f.