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



Introduced in

Version:2.05

Description

Description:

Applies a dispersion factor to all the unit weapons.

Note: This command does not affect vehicles or man portable missile / rocket systems (such as RPGs). If used in combination with showShotTrajectories, it must be run using publicExecOtherwise, the shot is incorrectly visualized (but not incorrectly simulated) on other clients.

This factor is applied to the original accuracy setting of each individual weapon, so the absolute effect on a weapon that is originally very accurate is less than that of a less accurate one (for example, a factor of 10 on a sniper rifle may result in a 10cm dispersion, whereas if applied to a handgun the dispersion may be 50cm). The default factor is 1, so it is possible to increase the accuracy by setting it to a value < 1 (or even 0, for no dispersion).

Syntax

Syntax:unit setDispersionFactor dispersion
Parameters:
  • unit: Object - Unit whose weapons are affected.
  • dispersion: Number - Factor to apply to the unit weapons.
Return Value:Nothing

Examples

Examples:
player setDispersionFactor 10;

Additional Information

See also: getDispersionFactor, setUnitRecoilCoefficient, setWeaponSwayFactor
Multiplayer:
Problems:

Notes