turretWeaponDirection (VBS2)
From Bohemia Interactive Community
| Editors, please check Policy: Scripting Command Page Syntax. |
Click on the images for descriptions
Introduced in
- Game:
- Virtual Battlespace 2
- Version:
- 1.00
Description
- Description:
- Returns direction turret is aiming at.
Syntax
- Syntax:
- vehicle turretWeaponDirection [weaponpath, weaponname]
- Parameters:
- vehicle: Object -
- weaponpath: Number -
- weaponname: String - optional
- Return Value:
- Vector3D
Examples
- Example 1:
_dir = _vehicle turretWeaponDirection [[0]]
Additional Information
- Multiplayer:
- Behaviour unknown.
- See also:
- setWeaponDirection
Notes
Notes
Notes
- Available weaponnames can be found in weapon_mag_classnames.pdf delivered with VBS2.
- The given direction vector is in world coordinates, so it is independent of the vehicle orientation.
- To find out which turrets are available on a vehicle, and what the syntax is, you can use this script.
- To convert the returned array into a degree value, use this formula:
_dir = (_vect select 0) atan2 (_vect select 1);

