I imagine you have to dedicate a level to it (character selection level?). And in that level the screen offers several choices. But then once they choose the character they want, assuming bp’s have been made for character A B C D etc etc… The game starts with that chosen character. But when that choice was made, there must be a variable or something set somewhere to tell the game ok player one chose player C for example.
Like in the project settings on maps and modes where you choose the default pawn.
You can’t update the GameMode Blueprint during gameplay. You can only do that in the editor itself for a specific level since the GameMode is attached to a level.
What you COULD have for each Character is a small level with the respective blueprints attached to them and load sub-level assets that will build the rest of your level. But honestly? That is too much work to do something that actually looks simple.
What I would recommend is, If your Characters have the same functionality, all you really need to do is to switch the Skeletal Mesh of the player Blueprint.
You could create a simple Struct and add only a Skeletal Mesh property and create a DataTable from it with all your playable characters.
When you get to your character select level just iterate trough the records on that table. Whenever the player picks the selected character just store the row name as a string in a save game slot. When your next level loads get the record from the DataTable and set the player Mesh as the SkeletalMesh that matches the row with the row name you saved in the last level.
For different characters (e.g. fighting games) you’d use class inheritance. Create a parent character class, then create child classes and change the mesh, abilities etc per a config created in the parent.
How to handle character selection depends on the game. Look at the Battlefield series for example. They have classes in which you choose before spawning. It’s all UI based. No level streaming/change.
The “Default Pawn Class” in world settings doesn’t have to be used. The game mode is coded to instantly spawn and possess a pawn when a connection is made. It needs a pawn class to do this. You can easily create a do nothing/empty pawn class and use that as the default.
Spawn a default pawn, Load your UI.
Client makes choice, passes value to Server (Event :: Run on server).
Server receives value, Destroys old pawn class (whatever you use to load in with), spawns chosen class and possesses it.
Is there no way to have the characters in an array and then say “Spawn the one in slot 3” ?
I created a base class for all my characters then duplicated the BP to select the various stuff that make the character unique. Now I have those blueprints in an array and don’t know how to spawn from that since everything has the same class and SpawnActor(Class) doesn’t have a way to specify which character to use
Oh man, it seems like a lot of red tape. That IMHO is alot more complicated by default than it should be. It seems you are on the right track with dedicating an entire level to it. Just have essentially a dummy or empty level and have it load a widget for your character selection screen. Store player choices / character choices in the game instance, that will keep those choses when the action map loads.