I need to make it so that when i switch the scean and come back that Text2,3,4 and 5 are disabled. Text2.3.4 and 5 are empty game objects with box colliders.
void OnTriggerEnter2D(Collider2D other)
{
if (other.gameObject.tag == “killbox”)
{
Debug.Log(“Worked”);
theGameManager.RestartGame();
moveSpeed = moveSpeedStore;
speedMilestoneCount = speedMilestoneCountStore;
moveSpeed = 5f;
}
if (other.gameObject.tag == “Text2” )
{
Text2.GetComponent().enabled = true;
SceneManager.LoadScene(“Text2”);
}
if (other.gameObject.tag == “Text3”)
{
Text3.GetComponent().enabled = true;
SceneManager.LoadScene(“Text3”);
}
if (other.gameObject.tag == “Text4”)
{
Text4.GetComponent().enabled = true;
SceneManager.LoadScene(“Text4”);
}
if (other.gameObject.tag == “Text5”)
{
Text5.GetComponent().enabled = true;
SceneManager.LoadScene(“Text5”);
}
}
}