PLEASE HELP ACTIVE SELVE NOT WORKING :)

ok i want to detect is a clone is active using a tag
if (GameObject.FindGameObjectWithTag (“Medium”).activeSelf)
but the .activeSelf is not working and is not checking if the clone is active or not
please i cannot go further into my game and i cant find anyone else with this error

//clone that are not active not register and skips the .activeself function ??

Hi @The_Cookie_Rooster. It’s hard to tell without seeing more of your code and game but is the parent of your GameObject active? If not, this could be throwing you off. Perhaps try:

if(GameObject.FindGameObjectWithTag(“Medium”).activeInHeirarchy)

instead of activeSelf.

See the Unity docs here:

and here:

I hope this helps.

Regards.

Take a look at the following snippet. I know it is a little more that you posted, but it will help you determine what the problem is.

if (GameObject.FindGameObjectWithTag ("Medium") != null)
{
    GameObject go = GameObject.FindGameObjectWithTag ("Medium");
    Debug.Log("Game object '" + go.name + "' is " + (go.activeSelf ? "active" : "inactive"));
    if (go.activeSelf)
    {
        // do something here
    }
}
else
{
    Debug.Log("There are no game objects with the tag of 'Medium'");
}