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


Introduced in

Version:2.21

Description

Description:Positions a personal weapon independently from the unit current animation. Once the weapon is positioned using this command, it is possible to change its direction with mouse movements, and the optics view and bullet path match the weapon orientation.

The unit animation does not change, and becomes "detached" from the weapon. For example, changing the stance (standing, kneeling, prone) does not change the position of the weapon, but moving around moves the weapon along (as its defined position is relative to the unit).
In order to be able to move the weapon while it is deployed, the movement limits have to be defined using setDeployedWeaponLimits. By default the limits are 0, and the weapon can only be used in the initial orientation.

To cancel the deployment, call the command with an empty argument.

Syntax

Syntax:unit deployWeapon [position, direction]
Parameters:
  • unit: Object - The unit.
  • position: Array - Position of weapon in model coordinates (relative to the unit).
  • direction: Vector3D - Initial direction of weapon.
Return Value:Nothing

Examples

Examples:
player deployWeapon [[0,1,.5], [.7,.6,0]]
Cancel deployment:
player deployWeapon []

Demo mission: deployWeapon.zip

Additional Information

See also: deployedWeapon, setDeployedWeaponLimits, setWeaponDirection
Multiplayer: 
Problems: 

Notes