Switching between multiple classes

Hello,

I’m currently working on a game where I want the player to be able to choose (before the start of the game) a character. It’s a fantasy game so it’s basically a mage and a warrior so far. Note that it’s in another scene that the choice is made and not in the level.

It works kinda like Skyrim with a First Person View so I have no models.

I have a character selection screen that brings me to the level 1 but my biggest problem is te object switching between the two characters since they have a whole bunch of scripts attached to them and I don’t really know how to disable everything from 1 to use everything from the other. My characters move at different speeds, don’t have the same life or mana or anything really.

I figured I probably don’t have to switch camera since I want to spawn exactly at the same place for both but except this part I don’t really know what I should do. I really want to remove everything linked to the mage from the world if the warrior is called for example and a simple Destroy object doesn’t work.

Can you help me with this one?

You could use SetActive on your characters. Read about it in the Scripting Reference

Ok so this is the character spawner :

int savedPlayer = 0;
	GameObject Character1;
	GameObject Character2;
	public static bool isMage = true;
		
	bool isPrincipal = false;
void Awake()
	{
		Character1 = GameObject.Find ("Mage");
		Character2 = GameObject.Find ("Guerrier");

		savedPlayer = PlayerPrefs.GetInt ("selected Character");
		if (savedPlayer == 1) {
						
						Character1.SetActive(true); 
						GameObject.Destroy(Character2); 
						isMage = true;
				}
		if (savedPlayer == 2) {
			Character2.SetActive(true); 
			GameObject.Destroy(Character1);
			isMage = false;

				}
		if (savedPlayer == 0) {
			Character1.SetActive(true); 
			GameObject.Destroy(Character2); 

			isMage = true;
			}
				} 

	}

And this is the character selector, I actually used SetActive but I think it’s the part where it has to put is to false that doesn’t work :

public bool isCharacter1 = false;
public bool isCharacter2 = false;
public bool isCharacter3 = false;
public bool isCharacter4 = false;

int nbCharacter = 4;
int selectedCharacter = 0;

void OnMouseUp()
{

	if (isCharacter1) {
					selectedCharacter = 1;
					PlayerPrefs.SetInt("selected Character", selectedCharacter);
					Application.LoadLevel("Tomjeu");			
			}
	if (isCharacter2) {
					selectedCharacter = 2;
		PlayerPrefs.SetInt("selected Character", selectedCharacter);
		Application.LoadLevel("Tomjeu");
			}
	if (isCharacter3) {
					selectedCharacter = 3;
		PlayerPrefs.SetInt("selected Character", selectedCharacter);
			}
	if (isCharacter4) {
					selectedCharacter = 4;
		PlayerPrefs.SetInt("selected Character", selectedCharacter);
			}
}

}