Periksa apakah GameObject aktif
if (gameObject.activeSelf)
{
// this happens when object is active
}
Comfortable Caterpillar
if (gameObject.activeSelf)
{
// this happens when object is active
}
// To check if a GameObject is active:
gameObject.activeSelf;
if (gameObject.activeInHierarchy)
gameObject.activeSelf //is active
!gameObject.activeSelf //isnt active