How To Control Two Different Characters With Keyboard?

instead of that I will give you the game viewport client (subclass) headers which is pre-edited to remove the restriction of keyboard. … follow these steps:

  1. Download the attachment and extract the files.
  2. Move both files to <Your Project Folder Path> \ Source \ <Your Project’s Name Folder>.
  3. Open your project.
  4. Compile these two files if needed (using visual studio)
  5. Open your project settings in the engine and select General Settings.
  6. Under the Default Classes header you shall find Game Viewport Client Class
  7. change it to MultiplayerViewPortClient (which the customized subclass) instead of GameViewPortClient.
  8. now in order to spawn the players you will have to create players in your level blueprint. (in my case I’ve created 3 players: one for the master camera actor which tracks both of them, and the others for my spawned character)

  1. Auto Possess your characters with players (according to how many players you want to possess or to have an individual controller) in my case I've possessed MainCharacter with Player_1 , and TheSecondCharacter with Player_2 , and the MasterCameraActor with Player_0
  2. map your special keyboard inputs to each one of them.
  3. Enjoy. :slight_smile:

follow[link text][2]