How to reference a component on child object when parent is active = false?

The structure is following:

-PopupWindow(parent)

–HealthValue(child,text) + component with UIText set to HealthValue game object

public class References : MonoBehaviour {

    public GameObject UIText;
    public Text Ref_TextValue;

    void Awake() {
        Ref_TextValue = UIText.GetComponent<Text>();
    }
}

I need popup to be hidden from the start but with values set from script.
But if I uncheck “Active” checkbox on popup parent game object - I get NullReferenceException when trying to reference Ref_TextValue through HealthValue.GetComponent().Ref_TextValue.

It works good if active checkbox on parent is on.

Am I missing something?

You cannot reference a game object if its parent is inactive?

Can I make popup game object invisible from the start and making it visible on the run?

without Enabeling/Disabeling GameObject you can Change Color of the Text From Invisible to visible.

Color yourColor;

void Awake()
{
yourColor=UIText.Color;//get your custom color
UIText.color=Color.Clear;//hides the text
}


void showPopUp()
{
UIText.color=yourColor;
}