Page tree
Skip to end of metadata
Go to start of metadata



Introduced in

Version:3.3

Description

Description:Returns movement speed, relative to another object.

Depending on the syntax used, the speed is relative to either the surface / object the unit is currently moving on, or relative to a specific object. It also depends on the direction the unit is facing. While in vehicles, the speed of a queried unit is zero, so the vehicle itself has to be checked.

Syntax

Syntax:relativeSpeed vehicle
Parameters:
  • vehicle: Object - Unit or vehicle.
Return Value:Number - Speed, relative to currently used surface or object (in km/h).

Alternative Syntax

Syntax:vehicle relativeSpeed object
Parameters:
  • vehicle: Object - Unit or vehicle.
  • object: Object - Object, speed should be referenced to.
Return Value:Number - Speed, relative to specified object (in km/h).

Examples

Examples:
Returns relative speed of 'heli1', relative to 'ship1':
_speed = heli1 relativeSpeed ship1

Additional Information

See also: speed, velocity, fn vbs absSpeed
Multiplayer:
Problems:

Notes