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)
{....}
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)
{
}
}