Entity::getVelocity: Difference between revisions

From RAGE Multiplayer Wiki
(yay)
 
No edit summary
Line 2: Line 2:
==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_function_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:TODO: Example]]

Revision as of 11:36, 30 November 2017

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