Vector3::subtract

From RAGE Multiplayer Wiki
Revision as of 05:47, 31 May 2019 by Micaww (talk | contribs) (Created page with "This function is used to subtract a Vector3 from another Vector3. ==Syntax== <pre> vector.subtract(Vector3 otherVec); </pre> ===Required Arguments=== *'''otherVec:''' Vector...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This function is used to subtract a Vector3 from another Vector3.

Syntax

vector.subtract(Vector3 otherVec);

Required Arguments

  • otherVec: Vector3: The vector to be subtracted from the callee.

Example #1

Server-Side
const vec1 = new mp.Vector3(50, 40, 30);
const vec2 = new mp.Vector3(10, 20, 15);

const difference = vec1.subtract(vec2); // difference = {x: 40, y: 20, z: 15}

See Also