If you’re interested in feedback on how the player switches characters – hotkeys, mouse clicks, menu, etc. – the Game Design forum might be a good place for that discussion.
If you’re talking scripting, a common approach is to use a virtual controller. Brett Laming at Rockstar wrote a good article for AIGPW4 about their MARPO architecture, which uses a virtual controller.
A virtual controller sits in the middle of your stack of scripts. Below it, lower-level scripts handle things like character stats, inventory, physics, animation, etc. They read control input from the virtual controller. Above it, the virtual controller receives control input from a player input controller when the character is player-controlled, and from an AI input controller when the player is AI-controlled.
To switch from AI control to player control, you simply disable the AI input control script and enable the player input control script. The virtual controller isolates the lower-level scripts from this, so they continue to function without any need for modification.
So a player-controlled character might have these scripts:
[PlayerControl:enabled] [AIControl:disabled]
v
[VirtualController]
v
[CharacterStats] [Inventory]
[Physics components] [AnimationManager]
[Animator]
And when the player relinquishes control, it would look like this:
[PlayerControl:disabled] [AIControl:enabled]
v
[VirtualController]
v
[CharacterStats] [Inventory]
[Physics components] [AnimationManager]
[Animator]
When the player clicks on a character B (relinquishing control of character A), set:
B.PlayerControl.enabled=true
B.AIControl.enabled=false
and set:
A.PlayerControl.enabled=false
A.AIControl.enabled=true
To “click on character B”, maybe add a script with OnMouseEnter, OnMouseUp, and OnMouseExit.
OnMouseEnter: Show some prompt text, maybe by enabling a world space UI canvas.
OnMouseExit: Hide the prompt text.
OnMouseUp: Enable player control of the character.
You’ll probably also want some kind of manager that keeps track of the currently-controlled character so you can return that one to AI control before taking control of the new character.