Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.



Introduced in

Version:1.22

Description

Description:Changes the default sway, depending on unit fatigue (see getFatigue). If set to 0, the weapon is fully steady.

Syntax

Syntax:setWeaponSwayFactor number
Parameters:
  • number: Number - Sway factor, from 0 - 1.
Return Value:Nothing

Alternative Syntax (VBS4 22.1+)

Syntax:unit setWeaponSwayFactor [amount, decay]
Parameters:
  • unit: Object - Affected unit.
  • amount: Number - Amount of extra weapon sway. The value represents the maximum angular offset from the aiming center in radians.
  • decay: Number - The weapon sway value gets reduced by this value periodically every second, until it gets down to zero (optional, default: 0).
Return Value:Nothing

Examples

Examples:
setWeaponSwayFactor 0;

player setWeaponSwayFactor [0.3, 0.001];

Additional Information

See also:getWeaponSwayFactor, weaponSwayFactor, setUnitRecoilCoefficient
Multiplayer:
Problems:

Notes