Unity Mirror - how to dynamically set player character

Im working on a 2D multiplayer fighting game (just like street figher), I am watching thru Mirror tutorials and I am confuse on how to dynamically set the look of the character in the game? by dynamic, i meant, the screen before the actual battle screen, there is a character selection where users need to choose, the chosen character becomes their look, and I am confuse how to set it the Network Manager in Mirror as the Spawn character.

Do we dynamically set the NetworkManager player prefab to the prefab of the selected character?
how to do this?

First off, I’d make the spawn character the “player controller” rather than the actual player character. This way, the player can also swap between different characters in the middle of the game as well. The player would always spawn as this player controller. The player controller takes possession of the player character prefab, and has authority over it.

As for the character:

I would use a combination of databases and structs to do this.

CharacterDB

  • Contains an array of character type structs
  • This struct contains the player prefab to spawn

When you join the server, you give it the int index of the player prefab the player would like to play as.

Now if you want skins for each character or even more customization options, you can create another customization database that contains the meshes and materials, and send this information as an int for the mesh to use and an int for the skin to use.