Skip to content

format

typescript
Vector3.Add(rhs)

class: Vector3

description

Adds the calling vector to the input parameter vector.

parameter

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

reture

typedescription
Vector3The result of the addition.

code example

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