Entity::getVelocity: Difference between revisions

From RAGE Multiplayer Wiki
(yay)
 
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
Get the velocity of the Entity


==Syntax==
==Syntax==
<syntaxhighlight lang="javascript">entity.getVelocity();</syntaxhighlight>
<syntaxhighlight lang="javascript">entity.getVelocity();</syntaxhighlight>
=== Required Arguments ===
 
===Return value===
===Return value===
*'''Vector3'''
*'''<font color='green'>Object Vector3'''</font>
 
==Example==
==Example==
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
// todo
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.
</syntaxhighlight>
</syntaxhighlight>
==See also==
==See also==
{{Entity_function_c}}
{{Entity_definition_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:TODO: Example]]

Latest revision as of 17:58, 1 May 2024

Get the velocity of the Entity

Syntax

entity.getVelocity();

Return value

  • Object Vector3

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