Hello,

I've been creating a dynamic mission involving many spawned in units and groups. Currently I would like the player to be able to switch between roles and units using the team switch menu within the map. Currently you can select any unit and the transition works. However the old unit no longer has AI.

I've tried this but it didn't work unfortunately.

  addMissionEventHandler["TeamSwitch", { _oldUnit = _this select 0; [_oldUnit] spawn { _oldUnit = _this select 0; _oldUnit enableAI "ALL"; hint "TURN ON AI"; }; }]; Any help would be appreciated. Thanks!
    Edit: Nevermind, got it with   null=[] spawn {sleep 0.5;onTeamSwitch "selectPlayer (leader _from); {_x doFollow leader _from} foreach units _from; selectPlayer _to;"} from here https://forums.bistudio.com/topic/167466-restart-ai-after-team-switch/