Vector2.MoveTowards||doc136393

September 20, 2022

Format

Vector2.MoveTowards(fromVec, toVec, moveDistance)

Describe

Calculate the vector after a certain vector moves the specified distance to the target vector, and it will not exceed the target vector.

parameter

Variable name Type Describe
fromVec Vector2 Starting vector
toVec Vector2 Endpoint vector
moveDistance float Movement amount

Return value

Type Describe
Vector2 Vector after moving