Перейти к содержанию

Entity::getVelocity

Материал из RAGE MP Wiki Archive

Get the velocity of the Entity

Syntax

<syntaxhighlight lang="javascript">entity.getVelocity();</syntaxhighlight>

Return value

  • Object Vector3

Example

<syntaxhighlight lang="javascript"> 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>

See also