how to find a gameObject only if it is active in unity using c# code example
Example: unity check if gameobject is active
// To check if a GameObject is active:
gameObject.activeSelf;
// To check if a GameObject is active:
gameObject.activeSelf;