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


Introduced in

Version:1.00

Description

Description: Returns the direction a weapon is aiming at.

To convert the returned array into a degree value, use this formula:
_dir = (_vect select 0) atan2 (_vect select 1)
To determine the vertical angle of the weapon, use asin on the 3rd returned element:
_angle = asin(player weaponDirection (primaryWeapon player) select 2)

Syntax

Syntax: object weaponDirection weapon
Parameters:
  • object: Object - Unit or vehicle equipped with weapon
  • weapon: String - Classname of weapon to check.
    Command can only check weapons in the primary turret of a vehicle (e.g. [1]). For "nested" turrets (e.g. [1,1]), use turretWeaponDirection or turretAzimuth.
Return Value: Vector3D - Direction vector [x, y, z] of checked weapon

Examples

Examples:
_dir = _vehicle weaponDirection "M16"

Additional Information

See also: setWeaponDirection, turretWeaponDirection, turretAzimuth, turretOpticsDirection
Multiplayer: 
Problems: 

Notes