Skip to content

format

typescript
Vector3.Sub(rhs)

class: Vector3

description

Subtracts the calling vector by the input parameter vector.

parameter

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

reture

typedescription
Vector3The result of the subtraction.

code example

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