is it possible to program a game that allow user to switch player as in the game level, for example the 2nd character follow 1st character as a dummy and user can switch to use the 2nd character?

if yes, how can it be made?