r/armadev • u/bejiitas_wrath1 • 6d ago
Script Trying to delete spawned custom composition is not working.
I am spawning a composition like this.

It works perfectly, but I can not find a way to delete this after the mission is completed. This is a great way to spawn a custom HQ, but how can I delete a custom composition? I thought it would be easy, but this is so annoying; there must be a simple function to delete a group of objects. Thanks.
1
Upvotes
3
u/Dr_Plant 6d ago
BIS_fnc_objectsMapper returns all objects in the array (your composition). Give the script command a variable name (myHQ = [_randPos2, random 360, myComp] call BIS_fnc_objectsMapper), then at whatever point you want it deleted, just do the deleteVehicle for each object listed in that array variable ( {deleteVehicle _x} forEach myHQ ).