Skip to content

format

typescript
Vector3.Get(index)

class: Vector3

description

Get the x, y, and z components of the current Vector3.

parameter

param_nametypedescription
indexnumberThe index of the vector component.

reture

typedescription
numberThe 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));