Spawning Player After Player Choice.

Hello everyone !

So this is what I need. The player will have to make a choice of what they want to play before the game starts. This of course is in a separate scene in the game.

So the player has a choice of 2 different kinds of characters, character A or character B. I have both characters already saved in a prefab. How do I make it so that it spawns what the character chose in the previous scene. I’m using C# so please make your answers in C# code.

I hope you guys understand what I need! Thanks in advance !

In your “character choosing” script set up two public static bools. Then when the user chooses their character set the corresponding bool to true, and the other to false.

Then in your next scene all you need to do in your “character spawning” script is, in Start() write the name of your character choosing script like so

if(characterChoosingScript.characterOneBool == true){
//Spawn character 1
}

This should be all you need to get your current request working.

If you have more than say, 4-5 characters, I’d recommend moving to an array of bools vs. individual.

Happy programming :slight_smile: