Garry's Mod Wiki

Vector:Sub

Vector:Sub( Vector vector )

Description

Substracts the values of the second vector from the orignal vector, this function can be used to avoid garbage collection.

Arguments

1 Vector vector
The other vector.

Example

Subtracts vector A's components with the other vector.

a = Vector(5, 6, 7) a:Sub(Vector(1, 2, 3)) print(a)
Output: 4 4 4

Example

If you don't want to set your vector to the result, and just return a new vector as the result. You can use a ' - ' operator to subtract two vectors from each other.

a = Vector(5, 6, 7) print(a-Vector(1, 2, 3))
Output: 4 4 4

Page Links


Special Pages


Wikis

?

Render Time: 36ms

DB GetPage 9
Generate Html 2
SaveChanges (1) 15
Render Body 0
Render Sidebar 7