Is it not possible to make a Game Object that is SetActive(false) to SetActive(true)?

I’m having a problem trying to solve my issue here where I change characters by making one SetActive(false) and another to SetActive(true) at the press of a button. I went through the documentation for the SetActive and I don’t see why I’m having this much problem.

Here is the code that I tried attempting this problem:

public class ChangeToSecondForm : MonoBehaviour 
{
	private static ChangeToSecondForm instance = null;
	public static ChangeToSecondForm Instance
	{
		get {return instance; }
	}

	private GameObject playerToBeChangedFrom;
	private GameObject playerChangingTo;

	public Transform secondFormDisplay;
	public int maxEnergy = 100;
	public int currentEnergy;
	private float energyOriginalXScale;

	// Use this for initialization
	void Start () 
	{
		currentEnergy = 100;
		energyOriginalXScale = secondFormDisplay.localScale.x;
		playerToBeChangedFrom = GameObject.FindGameObjectWithTag ("PlayerCharacter");
		playerChangingTo = GameObject.FindGameObjectWithTag ("PlayerCharacterSecondForm");
	}
	
	// Update is called once per frame
	void Update () 
	{
		if (currentEnergy <= 0) 
		{
			secondFormDisplay.GetComponentInChildren<Renderer>().enabled = false;
		}

		SecondForm ();
	}

	public void SecondForm()
	{
		if (Input.GetButtonDown ("TransformToSecond") && (currentEnergy == 100)) 
		{
			Debug.Log("Q has been pressed");

			playerToBeChangedFrom.SetActive (false);

			playerChangingTo.SetActive(true);
			currentEnergy = 0;

                    //This body of code is giving me the problem.
		}
	}

	public void GatherEnergy(int energyGathered)
	{
		Debug.LogError ("Got Energy from dead enemy.");
		
		currentEnergy += energyGathered;

		if (currentEnergy >= 100) 
		{
			currentEnergy = 100;
		}

		secondFormDisplay.localScale = new Vector3(energyOriginalXScale * (currentEnergy/maxEnergy), secondFormDisplay.localScale.z, secondFormDisplay.localScale.z);
	}
}

The problem is not the actual changing, but instead playerChangingTo = GameObject.FindGameObjectWithTag ("PlayerCharacterSecondForm"); will return null if the only Object tagged as "PlayerCharacterSecondForm" is disabled.

You’ll need to get a reference for playerChangingTo by some other means. Either directly through the inspector with a public GameObject field, or with some Character Manager script that has knowledge of all the possible player gameObjects and handles all the enabling/disabling.