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

Entity::getVelocity

Материал из RAGE MP Wiki Archive
Версия от 17:58, 1 мая 2024; imported>Shr0x (See also)
(разн.) ← Предыдущая версия | Текущая версия (разн.) | Следующая версия → (разн.)

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