Garry's Mod Wiki

Revision Difference

Vector#519202

<cat>classfunc</cat>⤶ List of all possible functions to manipulate vectors. Created by <page>Global.Vector</page>. Type | Name | Description ------ | -------------- | ------------------------------ <page>number</page> | **x** or **1** | The X component of the vector. <page>number</page> | **y** or **2** | The Y component of the vector. <page>number</page> | **z** or **3** | The Z component of the vector. <example> <description>Indexing by named component.</description> <code> local v = Vector( 1, 2, 3 ) print( v.x, v.y, v.z ) </code> <output>1 2 3</output> </example> <example> <description>Indexing by number (most efficient!).</description> <code> local v = Vector( 1, 2, 3 ) print( v[1], v[2], v[3] ) </code> <output>1 2 3</output> </example>