{"name":"BIS_fnc_spawnObjects","operator":null,"title":"BIS fnc spawnObjects","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_spawnObjects","revid":378126,"updated":"2026-02-21T14:35:37Z","groups":["Object Manipulation"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"1.00"}],"since":{"game":"arma3","name":"Arma 3","version":"1.00"},"arma3_since":"1.00","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Create a stack of objects at given position or on top of given object (eg. table).","syntaxes":[{"syntax":"[position, className, count, offsetMatrix, offsetDir, dirNoise, enableSimulation] call BIS_fnc_spawnObjects","since":null,"effect":null,"exec":null,"params":[{"name":"position","type":"Array format PositionASL, or Array as [referenceObject, placement]","optional":false,"default":null,"description":"Array format PositionASL, or Array as [referenceObject, placement]\n- referenceObject: Object\n- placement: String - can be:\n  - \"BOTTOM\" = at the bottom of the object\n  - \"TOP\" = top of the objects boundingbox\n  - \"GROUND\" = sitting just on the ground\n  - \"ROADWAY\" = sitting just on the ground","types":["Array","PositionASL"],"since":null,"text":"position: Array format PositionASL, or Array as [referenceObject, placement]\n- referenceObject: Object\n- placement: String - can be:\n  - \"BOTTOM\" = at the bottom of the object\n  - \"TOP\" = top of the objects boundingbox\n  - \"GROUND\" = sitting just on the ground\n  - \"ROADWAY\" = sitting just on the ground"},{"name":"className","type":"String","optional":false,"default":null,"description":"class of the object(s) to spawn; all will use the same class","types":["String"],"since":null,"text":"className: String - class of the object(s) to spawn; all will use the same class"},{"name":"count","type":"Number","optional":true,"default":"1","description":"how many objects will be spawned","types":["Number"],"since":null,"text":"count: Number - (Optional, default: 1) how many objects will be spawned"},{"name":"offsetMatrix","type":"Array","optional":true,"default":"[0, 0, 0]","description":"starting spawning position offset","types":["Array"],"since":null,"text":"offsetMatrix: Array - (Optional, default: [0, 0, 0]) starting spawning position offset"},{"name":"offsetDir","type":"Number","optional":true,"default":"0","description":"starting spawning direction offset","types":["Number"],"since":null,"text":"offsetDir: Number - (Optional, default: 0) starting spawning direction offset"},{"name":"dirNoise","type":"Code","optional":true,"default":"{ 0 }","description":"spawned object direction delta from the starting direction, defined as code returning dir delta value","types":["Code"],"since":null,"text":"dirNoise: Code - (Optional, default: { 0 }) spawned object direction delta from the starting direction, defined as code returning dir delta value"},{"name":"enableSimulation","type":"Boolean","optional":true,"default":"false","description":"shall the simulation of the spawned objects be enabled or not","types":["Boolean"],"since":null,"text":"enableSimulation: Boolean - (Optional, default: false) shall the simulation of the spawned objects be enabled or not"}],"returns":{"type":"Array of created Objects","types":["Array","Object"],"description":null,"text":"Array of created Objects"}}],"examples":[{"text":"```sqf\nprivate _randomPos = [(random 0.2) -0.1, (random 0.2) -0.1, 0];\n_objects = [[_table, \"TOP\"], \"Box_NATO_Wps_F\", 3, _randomPos, (random 20) - 10] call BIS_fnc_spawnObjects;\n```","code":["private _randomPos = [(random 0.2) -0.1, (random 0.2) -0.1, 0];\n_objects = [[_table, \"TOP\"], \"Box_NATO_Wps_F\", 3, _randomPos, (random 20) - 10] call BIS_fnc_spawnObjects;"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["createVehicle","createSimpleObject","enableSimulation"],"notes":[],"categories":["Arma 3: Functions","Arma 3: New Functions","Function Group: Object Manipulation","Functions","Introduced with Arma 3 version 1.00"],"docblock":null,"filled_from_docblock":[]}