Skip to content

Api > Vector2 > MoveTowards()


Vector2.MoveTowards(Vector2 current, Vector2 target, number maxDistanceDelta)⚓︎

Moves a point current towards target.

Parameters:⚓︎

Name Type Description
current Vector2
target Vector2
maxDistanceDelta number

Returns:⚓︎

type Description
Vector2 result

Usage⚓︎

---@type Vector2
local current;

---@type Vector2
local target;

---@type number
local maxDistanceDelta;


local val0 = Vector2:MoveTowards(current, target, maxDistanceDelta)