{"name":"BIS_fnc_boatRack01AdjustZOffset","title":"BIS fnc boatRack01AdjustZOffset","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_boatRack01AdjustZOffset","revid":379547,"updated":"2026-10-31T13:43:34Z","groups":["Boat Recovery"],"status":"ok","games":{"arma3":"1.84"},"since":"arma3 1.84","arma3_since":"1.84","description":"Part of the boat recovery system: raises or lowers the boat rack's cargo bay to suit the loaded boat, so that different boats do not clip into the rack.\nIt reads two entries of the rack's `CfgVehicles >> class >> BoatRecoverySystem` config class:\n\n- `cargoBayAnimationSelection` - name of the animation that moves the cargo bay, e.g. `\"CargoBay_Move_Z\"`\n- `supportedVehicleOffsetsZ[]` - list of `{ \"boatClass\", offset }` pairs, e.g. `{ { \"C_Boat_Civil_01_F\", 0.55 } }`\n\nIt then instantly animates the cargo bay to the offset of the boat's exact class (typeOf, inheritance is not checked), or to 0 if the class is not listed.\n\nThe function is called when the \"Recover Boat\" hold action of BIS_fnc_boatRack01ActionAdd has loaded a boat, and by BIS_fnc_boatRack01InitAdjustZOffsets for a boat loaded at mission start. It does nothing if either object is objNull.","syntaxes":[{"syntax":"[boatRack, boat] call BIS_fnc_boatRack01AdjustZOffset","params":[{"name":"boatRack","type":"Object","description":"the boat rack","type_expr":"Object"},{"name":"boat","type":"Object","description":"the boat loaded on the rack","type_expr":"Object"}],"returns":{"type":"Nothing","type_expr":"Nothing"}}],"examples":[{"text":"Load a boat onto a rack by script and adjust the rack to it, as the hold action does:\n\n```sqf\nif (myBoatRack setVehicleCargo myBoat) then\n{\n    [myBoatRack, myBoat] call BIS_fnc_boatRack01AdjustZOffset;\n};\n```","code":["if (myBoatRack setVehicleCargo myBoat) then\n{\n\t[myBoatRack, myBoat] call BIS_fnc_boatRack01AdjustZOffset;\n};"]}],"see_also":["BIS_fnc_boatRack01Init","BIS_fnc_boatRack01InitAdjustZOffsets","BIS_fnc_boatRack01ActionAdd","setVehicleCargo"]}