Arma 3 Scripting

Command in Object Manipulation, Weapons

setMissileTarget

Also available as Markdown and JSON, or read the original wiki page.

Description

Sets a guided missile target. Does not work for all types of missiles. If the target is dead, it is ignored. The target has to be inside the missile's configured targeting cone for the command to work.

Syntax

Syntax 1

munition setMissileTarget target

Parameters:

Returns: Boolean - true if successful

Syntax 2

since arma3 2.18

munition setMissileTarget [target, force]

Parameters:

Returns: Boolean - true if successful

Examples

Example 1

missile1 setMissileTarget tank1;

Example 2

private _missile = createVehicle ["Missile_AGM_01_F", player modelToWorld [0,0,50], [], 0, "CAN_COLLIDE"];
_missile setDir getDir player;
private _target = createVehicle ["O_APC_Wheeled_02_rcws_v2_F", player modelToWorld [0,300,0], [], 0, "CAN_COLLIDE"];
_target setVehicleTiPars [1, 1, 1];
[_missile, _target] spawn {
    params ["_missile", "_target"];
    sleep 0.1;
    _missile setMissileTarget _target;
};

Example 3

_missile setMissileTarget objNull; // cancels targeting

Example 4

_missile setMissileTarget [flare1, true];

See also

missileTargetPos · setMissileTargetPos · missileTarget · missileState