Entity::setVelocity
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.