Entity::setVelocity: Difference between revisions

From RAGE Multiplayer Wiki
No edit summary
 
Line 23: Line 23:
</syntaxhighlight>
</syntaxhighlight>
==See also==
==See also==
{{Entity_function_c}}
{{Entity_definition_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]

Latest revision as of 17:54, 1 May 2024

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