Entity::setVelocity

From RAGE Multiplayer Wiki
Revision as of 17:54, 1 May 2024 by Shr0x (talk | contribs) (→‎See also)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Note that the third parameter(denoted as z) is 'up and down' with positive numbers encouraging upwards movement.

Syntax

entity.setVelocity(x, y, z);

Required Arguments

  • x: float
  • y: float
  • z: float
  • Note: that the third parameter(z) is 'up and down' with positive numbers encouraging upwards movement.

Return value

  • Undefined

Example

let vehicle = mp.players.local.vehicle

let velocity = vehicle.getVelocity(); // returns a object with x, y , z

vehicle.setVelocity(velocity.x, velocity.y, velocity.z) // setting the velocity which we got.

See also