Check if game object is active in hierarchy from a prefab

If I want to check if game object is active I know I can use if(GameObject.ActiveInHierarchy){…}
But what I want to do now is check that from a prefab. I obviously can´t just drag and drop a game object into a prefab… so what do I do? I did already try to use…

FallOrFly = GameObject.FindGameObjectWithTag("FallOrFly");
        if (FallOrFly.activeInHierarchy == true)
        {....}

But it doesn´t seem to work?

Thanks.

FIXED IT!

I am sorry for not giving you all the information. The problem was that the prefab can´t detect inactive game objects so it returned null every time the game object was set to false. My way around it was to ad:

if (FallOrFly == null)
        {
        }
        if (FallOrFly != null)
        {
            if (FallOrFly.activeInHierarchy == true)
            {
               
            }
        }

Thank you for all responses.

Your code should work just fine on your prefab. But, let’s break it down Barney Style.

You’re using: FindGameObjectWithTag. Are you sure it’s TAGGED as such and not Named?

Are you sure the object is instantiated?

Where are you initiating this Find at? On the instantiated prefab? And if so where? In Start?