{"name":"BIS_fnc_setVehicleMass","operator":null,"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","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"1.00"}],"since":{"game":"arma3","name":"Arma 3","version":"1.00"},"arma3_since":"1.00","branch":null,"locality":{"argument":"local","effect":"global","server_exec":false},"exec":null,"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","since":null,"effect":null,"exec":null,"params":[{"name":"vehicle","type":"Object","optional":false,"default":null,"description":null,"types":["Object"],"since":null,"text":"vehicle: 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, ...]","types":["Boolean","Array"],"since":null,"text":"animationInformation: Boolean or Array - (Optional, default `[]`)\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)","types":["Number"],"since":null,"text":"massDifference: Number - (Optional, default 0) value to add to the mass (can be negative)"}],"returns":{"type":"Boolean","types":["Boolean"],"description":"success state","text":"Boolean - 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;"]},{"text":"```sqf\n// 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;\n```","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;"]},{"text":"```sqf\n// will do the same as the first example, then subtract 150 to the mass\nresult = [this, [], -150] call BIS_fnc_initVehicle;\n```","code":["// will do the same as the first example, then subtract 150 to the mass\nresult = [this, [], -150] call BIS_fnc_initVehicle;"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["setMass","setCenterOfMass"],"notes":[],"categories":["Arma 3: Functions","Arma 3: New Functions","Function Group: Object Manipulation","Functions","Functions: Global Effect","Introduced with Arma 3 version 1.00"],"docblock":null,"filled_from_docblock":[]}