format
typescript
Vector3.Get(index)class: Vector3
description
Get the x, y, and z components of the current Vector3.
parameter
| param_name | type | description |
|---|---|---|
| index | number | The index of the vector component. |
reture
| type | description |
|---|---|
number | The component of the vector. |
code example
typescript
let a = new Vector3(1,2,3);
//Get the x component of the vector
Debug.Log("a x is:",a.Get(0));
//Get the y component of the vector
Debug.Log("a y is:",a.Get(1));
//Get the z component of the vector
Debug.Log("a z is:",a.Get(2));