Weapon holders are used to hold small objects like weapons, magazines and other items you normally find on the player. Weapon holders have user actions added to them and their content can be viewed just like one views gear or inventory. If there are more than 1 item placed in weapon holder the items would appear to be spread around.

In ArmA 2 the weapon holder object is just called that – WeaponHolder. In ArmA 3 there are at least 2 different weapon holder objects I know of. One is called GroundWeaponHolder and another one is WeaponHolderSimulated. The difference is that simulated weapon holder is kind of affected by environment. If you place it above the ground for example it will fall down on the ground. Ground weapon holder, on the other hand, will be floating in the air. Also I suspect that simulated weapon holder would be synced over network a bit more often.

To make a weapon holder rotate is pretty simple. Since it is an object you can just set its direction with setDir command. But remember I said items get spread around when you place them in? This means that the item you place inside most likely won’t be in weapon holder’s default rotation centre. In this case it would probably be easier to attach weapon holder to another object, centre it with the object then rotate the object instead of weapon holder. In my example I used a can of Red Bull as turntable.

wp2

Of course you need to hide it afterwards, or perhaps use an invisible object in the first place. The weapon holder also needs to be adjusted as it is horizontal by default when created. The code below is just an example, it will spawn this FN F2000 looking rifle and rotate it for 10 seconds before deleting everything:

fnc_pwrotate = { private ["_turntable","_holder","_time","_dir"]; _turntable = createVehicle [ "Land_Can_V3_F", _this select 0, [], 0, "CAN_COLLIDE" ]; _turntable hideObject true; _holder = createVehicle [ "WeaponHolderSimulated", _this select 0, [], 0, "CAN_COLLIDE" ]; _holder addWeaponCargoGlobal [_this select 1, 1]; _holder attachTo [_turntable, [0,-0.63,0.7]]; _holder setVectorDirAndUp [[0,0,1],[0,-1,0]]; _time = time + 10; _dir = getDir _turntable; waitUntil { _dir = _dir + ( if (_dir > 360) then [{-360},{3}] ); _turntable setDir _dir; time > _time }; deleteVehicle _holder; deleteVehicle _turntable; };

To spawn the function (has to be spawned not called):

_null = [ player modelToWorld [0,2,0], "arifle_Mk20_ACO_pointer_F" ] spawn fnc_pwrotate;

Enjoy,
KK