S&box Wiki

Vector3.Distance

Vector3.Distance

Syntax

float Distance( Vector3 target )

Description

Return the magnitude of a vector. Equivalent of doing

(targetVector - originVector).Length

Please note that this is calculated using a square root and a square root calculation is quite expensive. If you just want to compare 2 distances consider doing

(targetVector - originVector).LengthSquared > (distance * distance)

Arguments

Vector3 target

Returns

float distance

Special Pages


Wikis

?

Render Time: 51ms

DB GetPage 40
Generate Html 0
SaveChanges (1) 7
Render Body 0
Render Sidebar 0