S&box Wiki

Vector3.AddClamped

Syntax

Vector3 AddClamped( Vector3 toAdd, float maxLength )

Description

Try to add to this vector. If we're already over max then don't add. If we're over max when we add, clamp in that direction so we're not.

Arguments

Vector3 toAdd
float maxLength

Returns