As the title says, I cannot get a gameobject to become active. Its a UI panel object that is supposed to display after a fight and give a You win or You lose box to the player.
public class OutcomeScript : MonoBehaviour {
public GameObject outcomePanel;
void Start () {
outcomePanel.SetActive(false);
}
public void Outcome(int outcome) {
if(outcome == 0)
{
outcomePanel.SetActive(true);
outcomePanel.GetComponentInChildren<Text>().text = "You Win!";
outcomePanel.GetComponentInChildren<Button>().GetComponentInChildren<Text>().text = "Continue...";
}
else
{
//"You lose" stuffs
}
}
I have confirmed that the function to set the object to active is being called correctly and passing the correct integer. I have also confirmed that the parent of the object (the UI canvas) is active and all of its children are active as well.
I’m not sure where to go from here, any help is appreciated.
Note: I’m in Unity 5.5.3 if that has any effect