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

Entity::setVelocity

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

Note that the third parameter(denoted as z) is 'up and down' with positive numbers encouraging upwards movement.

Syntax

<syntaxhighlight lang="javascript">entity.setVelocity(x, y, z);</syntaxhighlight>

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

<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