hello have a lil question about how to set an unit ai as gunner of static weapon.
im using this code.. the ai set as gunner as well but after 10 seconds, the ai die alone
server side script
_spawnstaticsguns = true;
if (_spawnstaticsguns) then {
_statictype = ["KORD_high_TK_EP1","DSHKM_Ins","M2StaticMG"] call BIS_fnc_selectRandom;
_objectsm2 = createVehicle [_statictype, [(_position select 0) - 5, (_position select 1) - 4,0],[], 0, "CAN_COLLIDE"];
_objectsm2 setDir 0;
_objectsm2 setVectorUp surfaceNormal position _objectsm2;
_objectsm2 setVehicleLock "LOCKED";
_objectsm2 setVehicleAmmo 1;
//_objectsm2 setVehicleVarName "gun";
sleep 1;
_group_gunner = createGroup _center_1;
_enemygunner = objNull;
_enemygunner = _group_gunner createUnit [_enemytype,_mainpos,[],0,"CAN_COLLIDE"];
_enemygunner moveingunner _objectsm2;
//_enemygunner setVehicleInit "this MoveInGunner gun;";
};