{"name":"setBehaviour","title":"setBehaviour","type":"command","url":"https://community.bistudio.com/wiki/setBehaviour","revid":364537,"updated":"2024-05-16T20:46:45Z","groups":["Groups","AI Behaviour"],"status":"ok","games":{"ofp":"1.00","ofpe":"1.00","arma1":"1.00","arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"ofp 1.00","arma3_since":"0.50","locality":{"argument":"local","effect":"global"},"description":"Sets individual unit behaviour **on every unit in a group**.\n\n> [!IMPORTANT]\n> This command doesn't set AI Group behaviour, see setCombatBehaviour or setBehaviourStrong for this.\n\n> [!NOTE]\n> See AI Behaviour for details of the effect of this command on AI units.\n\n| Command | Applies To |\n|---|---|\n| setBehaviour | **Every unit** in the group, but **not the group** itself |\n| setBehaviourStrong | **Every unit** in the group, and the **group** itself |\n| setCombatBehaviour | If argument is Object, only that **unit**, and if argument is Group, the **group** itself (not its units) |","syntaxes":[{"syntax":"groupOrUnit setBehaviour behaviour","params":[{"name":"groupOrUnit","type":"Group or Object","description":"unit or a group","type_expr":"Group | Object","text":"groupOrUnit : Group or Object - unit or a group"},{"name":"behaviour","type":"String","description":"can be one of:\n\n- \"CARELESS\"\n- \"SAFE\"\n- \"AWARE\"\n- \"COMBAT\"\n- \"STEALTH\"","type_expr":"String"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"binary","left":{"text":"groupOrUnit"},"right":{"text":"behaviour"}}],"examples":[{"code":["_group1 setBehaviour \"SAFE\";"]}],"see_also":["setCombatBehaviour","combatBehaviour","AIBehaviour","behaviour","setBehaviourStrong","setWaypointBehaviour","combatMode","setCombatMode","skill","setSkill","Arma 3: AI Skill"],"notes":[{"user":"SNKMAN","date":"2009-01-03T15:57:00Z","text":"Warning! Since Armed Assault v.1.14 the command setBehaviour \"COMBAT\" does not work correctly any longer.\nUnits ( Groups ) which are using this behaviour and then get a move order will not move to the given position."},{"user":"MadRussian","date":"2010-02-14T08:19:00Z","text":"Although setBehaviour can be called on an individual unit, the entire group will be affected."},{"user":"MulleDK13","date":"2010-11-22T19:18:00Z","text":"If setting a behaviour on an individual unit is required, it can be achieved by creating a temporary group, use joinSilent to make the individual unit belong to that group, then change his behaviour, use joinSilent into the original group, then delete the temporary group."}]}