Garry's Mod Wiki

Garry's Mod Wiki

  Vector:Mul( number multiplier )
  Vector:Mul( Vector multiplier )
  Vector:Mul( VMatrix matrix )

Description

Scales the vector by the given number (that means x, y and z are multiplied by that value), a Vector (X, Y, and Z of each vector are multiplied) or a VMatrix (Transforms the vector by the matrix's rotation/translation).

Default Arguments

1 number multiplier
The value to multiply the vector with.

Argument Overload 1

1 Vector multiplier
The vector to multiply the vector with.

Argument Overload 2

1 VMatrix matrix
The matrix to transform the vector by.

Example

Scales a vector by 250.

a = Vector(1, 1, 1) a:Mul(250) print(a)
Output:
250 250 250

Example

If you don't want to modify your existing vector and instead return a new vector as the result, you can use the * operator.

a = Vector(1, 1, 1) print(a*250)
Output:
250 250 250

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated four times a day. Edits and history are not available.

Last Parsed: Loading...