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