{"name":"BIS_fnc_setVehicleMass","title":"BIS fnc setVehicleMass","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_setVehicleMass","revid":327965,"updated":"2022-07-13T13:59:07Z","groups":["Object Manipulation"],"status":"ok","games":{"arma3":"1.00"},"since":"arma3 1.00","arma3_since":"1.00","locality":{"argument":"local","effect":"global"},"description":"Set mass relative to the default vehicle mass (default mass being vehicle mass on first execution of this function).","syntaxes":[{"syntax":"[vehicle, animationInformation, massDifference] call BIS_fnc_setVehicleMass","params":[{"name":"vehicle","type":"Object","type_expr":"Object"},{"name":"animationInformation","type":"Boolean or Array","optional":true,"default":"`[]`","description":"Boolean - true to take current animations mass in consideration, false to set \"raw\" mass\n- Array - animation sources and phases to format [\"animationSource1\", 1, \"animationSource2\", 0, ...]","type_expr":"Boolean | Array","text":"animationInformation: Boolean or Array - (Optional, default `[]`)\n\n- Boolean - true to take current animations mass in consideration, false to set \"raw\" mass\n- Array - animation sources and phases to format [\"animationSource1\", 1, \"animationSource2\", 0, ...]"},{"name":"massDifference","type":"Number","optional":true,"default":"0","description":"value to add to the mass (can be negative)","type_expr":"Number","text":"massDifference: Number - (Optional, default 0) value to add to the mass (can be negative)"}],"returns":{"type":"Boolean","type_expr":"Boolean","description":"success state"}}],"examples":[{"text":"```sqf\n// default behaviour, change the mass according to the current phase of the animation sources\nresult = [this]            call BIS_fnc_setVehicleMass;\nresult = [this, [], 0]    call BIS_fnc_setVehicleMass;\n```","code":["// default behaviour, change the mass according to the current phase of the animation sources\nresult = [this]\t\t\tcall BIS_fnc_setVehicleMass;\nresult = [this, [], 0]\tcall BIS_fnc_setVehicleMass;"]},{"code":["// doesn't care about the current phase of animations, it will change the mass for the given sources\nresult = [this, [\"source1\", 1, \"source2\", 0]] call BIS_fnc_initVehicle;"]},{"code":["// will do the same as the first example, then subtract 150 to the mass\nresult = [this, [], -150] call BIS_fnc_initVehicle;"]}],"see_also":["setMass","setCenterOfMass"]}