llw_getShootVector = { params ["_object","_pitchUp","_shootDir"] private ["_vector"]; // calculate barrel vector at 0 deg. object angle _vector = [ (cos _pitchUp) * (sin _shootDir), (cos _pitchUp) * (cos _shootDir), (sin _pitchUp) ]; _vector = _vector vectorAdd vectorUp _object; return vectorNormalized _vector; } _barrelpitch = _this select 0; _barreldir = _this select 1; _barrelroll = _this select 2; _charge = _this select 3; _theshell = "LLW_81mm_HEPD_004" createVehicle [getpos theplayer select 0, getpos theplayer select 1, 0.5]; //barrelpitch = 819; _pitchdegrees = _barrelpitch / 17.777777; //_charge = 314; _theshell setdir _barreldir; [_theshell, _pitchdegrees, 0] call BIS_fnc_setPitchBank; _startvelocity = _theshell setVelocity (_charge vectorMultiply [_artilleryObject,_pitchdegrees,_barreldir] call llw_getShootVector) hint str velocity _theshell; //player attachto [_theshell, [0,0,0]];