{"name":"fire","title":"fire","type":"command","url":"https://community.bistudio.com/wiki/fire","revid":379420,"updated":"2026-10-31T00:04:09Z","groups":["Unit Control","Weapons"],"status":"ok","games":{"ofp":"1.00","ofpe":"1.00","arma1":"1.00","arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"ofp 1.00","arma3_since":"0.50","locality":{"argument":"local","effect":"global"},"description":"Forces a unit to fire the given weapon.\n\n> [!NOTE]\n> Just like with forceWeaponFire it is possible to pass remote unit as argument, but this could be unreliable. Considering this command might need to be used in combination with selectWeapon, which takes only local arguments, it would make sense to execute the fire command where the unit is local as well.","syntaxes":[{"syntax":"unit fire muzzle","params":[{"name":"unit","type":"Object","description":"unit that is supposed to fire","type_expr":"Object"},{"name":"muzzle","type":"String","description":"name of the muzzle to be fired","type_expr":"String"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"binary","left":{"text":"unit"},"right":{"text":"muzzle"}},{"syntax":"unit fire [muzzle, mode, magazine]","params":[{"name":"unit","type":"Object","type_expr":"Object"},{"name":"muzzle","type":"String","type_expr":"String"},{"name":"mode","type":"String","type_expr":"String"},{"name":"magazine","type":"String","optional":true,"type_expr":"String","text":"magazine: String - (Optional)"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"binary","left":{"text":"unit"},"right":{"text":"[muzzle, mode, magazine]"}}],"examples":[{"code":["_soldier fire \"M16\";"]},{"code":["_soldier fire \"SmokeShellMuzzle\";"]},{"code":["_soldier fire [\"SmokeShellMuzzle\", \"SmokeShellMuzzle\", \"SmokeShellRed\"];"]},{"code":["player playActionNow \"PutDown\";\nplayer selectWeapon \"DemoChargeMuzzle\";\nplayer fire [\"DemoChargeMuzzle\", \"DemoChargeMuzzle\", \"DemoCharge_Remote_Mag\"];\nplayer setWeaponReloadingTime [player, \"DemoChargeMuzzle\", 0];"]}],"see_also":["BIS_fnc_fire","doFire","commandFire","canFire","fireAtTarget","forceWeaponFire","commandArtilleryFire","commandSuppressiveFire","doArtilleryFire","doSuppressiveFire","isManualFire","selectWeapon","ArmA: Actions"],"notes":[{"user":"Str","date":"2006-08-17T00:00:00Z","text":"Sometimes AI won't shoot when you use this command. It can be fixed by placing selectWeapon command before it."},{"user":"Ceeeb","date":"2007-02-02T00:00:00Z","text":"In **OFP v1.96**, when a man class unit is given this command, he will aim up in the air before firing his weapon. This makes it rather useless if you want to make him shoot a target. It does work with vehicles, when the vehicle is first given a doWatch or doTarget command."},{"user":"Bdfy","date":"2007-01-20T00:00:00Z","text":"In **ArmA v1.02**, this command is not working with weapons in the secondary turrets (like \"DSHKM\" in T-72)"},{"user":"Kronzky","date":"2008-01-15T00:00:00Z","text":"To place a satchel (pipebomb) the syntax is:\n**OFP**: unitname Fire [\"put\", \"pipebomb\"]\n**ArmA**: unitname Fire [\"pipebombmuzzle\", \"pipebombmuzzle\", \"pipebomb\"];\n*The triggering is done via a \"TOUCHOFF\" action.*"},{"user":"Mr.g-c","date":"2010-03-18T00:00:00Z","text":"In Arma 2, AI will automatically shoot straight up. Command seems to be broken."},{"user":"Mikhail","date":"2010-11-24T00:00:00Z","text":"Command is broken - confirmed. Use action \"USEWEAPON\" instead.\nPlace a game logic in the editor. Name it **MyGameLogic**.\nUse this code to make **unit1** fire his primaryweapon:\n\n```sqf\nMyGameLogic action [\"useWeapon\", primaryWeapon unit1, unit1, 0];\n```"},{"user":".kju","date":"2011-02-25T00:00:00Z","text":"Command works just fine in A2/OA. Make sure to execute it on **local** AI."},{"user":"Max Power","date":"2012-04-06T00:00:00Z","text":"If it did work at one time, it does no longer. The AI (or player) is forced to look upwards or reacts to a massive recoil force before getting his shot off."},{"user":"hcpookie","date":"2013-02-16T00:00:00Z","text":"Command did not work with Arma 2:ACR v1.62. Use fireAtTarget instead."},{"user":"Killzone_Kid","date":"2014-06-04T21:14:00Z","text":"In Arma 3 in order for AI to place Claymore, for example, it is necessary to execute 3 statements - an animation, weapon select and the actual fire command. Animation is most likely for forcing unit to leave rest state, weapon select and fire kinda both go together anyway:\n\n```sqf\n_unit playActionNow \"PutDown\";\n_unit selectWeapon \"DirectionalMineRemoteMuzzle\";\n_unit fire [\n    \"DirectionalMineRemoteMuzzle\",\n    \"DirectionalMineRemoteMuzzle\",\n    \"ClaymoreDirectionalMine_Remote_Mag\"\n];\n```"},{"user":"SteveStevenson","date":"2017-11-25T00:00:00Z","text":"In Arma 3, as of version 1.76, examples 2 and 3 in the section above for smoke grenades are no longer working.\nAs a workaround (throwing green smoke grenades for example), you can use:\n\n```sqf\n[_soldier, \"SmokeShellGreenMuzzle\"] call BIS_fnc_fire;\n```"}]}