Script language:

  • JS
  • C#
  • Boo
Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

Suggest a change

Vector2.ClampMagnitude

static function ClampMagnitude(vector: Vector2, maxLength: float): Vector2;
static Vector2 ClampMagnitude(Vector2 vector, float maxLength);
static def ClampMagnitude(vector as Vector2, maxLength as float) as Vector2

Description

Returns a copy of vector with its magnitude clamped to maxLength.

Your name (optional):
Your email (optional):
Please write your suggestion here: