check if gameobject is active

Code Example - check if gameobject is active

                
                        if (gameObject.activeSelf)
{
	// this happens when object is active
}
                    
                
 

unity check if gameobject is active

                        
                                // To check if a GameObject is active:
gameObject.activeSelf;
                            
                        
 

unity check gameobject active

                        
                                if (gameObject.activeInHierarchy)