Legacy Documentation: Version 5.3
LanguageEnglish
  • C#
  • JS

Script language

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

Vector2.ClampMagnitude

public static Vector2 ClampMagnitude(Vector2 vector, float maxLength);

Parameters

Description

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