{"name":"setUnitTrait","title":"setUnitTrait","type":"command","url":"https://community.bistudio.com/wiki/setUnitTrait","revid":379077,"updated":"2026-09-26T23:03:38Z","groups":["Object Manipulation"],"status":"ok","games":{"arma3":"1.58"},"since":"arma3 1.58","arma3_since":"1.58","locality":{"argument":"local","effect":"global"},"description":"Enables or disables a trait or alters a trait of the given unit. Unit traits consist of unit abilities, which are Booleans and modifiers, which are Numbers. Custom trait can only be a bool.\n\n> [!NOTE]\n> The command can also be used on vehicles (and drones), and it will get applied to the effectiveCommander of the vehicle. In addition, if the effectiveCommander has a trait, it will get applied to the entire vehicle (for example, the vehicle can become harder to spot due to low **camouflageCoef**)\n\nAbilities:\n\n- Boolean **engineer** - Ability to partially repair vehicles with toolkit, equivalent to `engineer = 1;` in CfgVehicles\n- Boolean **explosiveSpecialist** - Ability to defuse mines with toolkit, equivalent to `canDeactivateMines = 1;` in CfgVehicles\n- Boolean **medic** - Ability to treat self and others with medikit, equivalent to `attendant = 1;` in CfgVehicles\n- Boolean **UAVHacker** - Ability to hack enemy and friendly drones, equivalent to `uavHacker = 1;` in CfgVehicles\n\nModifiers:\n\n- Number **audibleCoef** - A lower value means the unit is harder to hear\n- Number **camouflageCoef** - A lower value means the unit is harder to spot\n- Number **loadCoef** - Equipment weight multiplier affecting stamina regeneration and max stamina\n- Number **staminaDrainCoef** - Since Arma 3 v2.22, Influences how quickly stamina is drained. **Do not set negative values!**","syntaxes":[{"syntax":"unit setUnitTrait [skillName, value, isCustom]","params":[{"name":"unit","type":"Object","description":"the unit whose trait should be set","type_expr":"Object"},{"name":"skillName","type":"String","description":"name of the skill","type_expr":"String"},{"name":"value","type":"Boolean or Number","description":"value (see above)","type_expr":"Boolean | Number"},{"name":"isCustom","type":"Boolean","optional":true,"description":"Must be set to true in case of custom","type_expr":"Boolean","text":"isCustom: Boolean - (Optional) Must be set to true in case of custom"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"binary","left":{"text":"unit"},"right":{"text":"[skillName, value, isCustom]"}}],"examples":[{"code":["player setUnitTrait [\"Medic\", true];"]}],"see_also":["getUnitTrait","getAllUnitTraits"],"notes":[{"user":"R3vo","date":"2016-04-27T18:12:00Z","text":"The higher the value for the loadCoef the less stamina a unit has. Negative values will dramatically increase the stamina actually to a point where it extends the stamina bar."},{"user":"Midnight","date":"2017-10-20T05:49:00Z","text":"The `explosiveSpecialist` trait can defuse mines (i.e. satchel charges), whilst the engineer trait alone cannot."},{"user":"Honger","date":"2026-09-26T23:03:38Z","text":"Setting **staminaDrainCoef** to a negative value will gradually replenish stamina/reduce fatigue when running/sprinting. Walking or standing will not be affected."}]}