Skip to content

format

typescript
Vector3.AddAssign(rhs)

class: Vector3

description

Add to self, adds the vector with the parameter vector and assigns the result to the calling vector.

parameter

param_nametypedescription
rhsnumber|Vector3The vector to be added, can be a number or Vector3.

reture

typedescription
void

code example

typescript
let lhs = new Vector3(1,2,3);
let rhs = new Vector3(3,4,5);
lhs.AddAssign(rhs);
Debug.Log("AddAssign result is",lhs);
lhs.AddAssign(1);
Debug.Log("AddAssign result is",lhs);