hello im trying to prefab sphere collider is Trigger option check/uncheck but its happened with original prefab(Bomb) not in prefab clone (Bomb clone). plz check the image
use this two code
private void OnTriggerStay(Collider other)
{
if (other.CompareTag("Bomb"))
{
BombGameObject.GetComponent<SphereCollider>().isTrigger = false;
Debug.Log(" stay ");
}
}
private void OnTriggerExit(Collider other)
{
if (other.CompareTag("Bomb"))
{
BombGameObject.GetComponent<SphereCollider>().isTrigger = true;
Debug.Log(" Exit ");
}
}
im also trying this code but not happened with clone prefab
private void OnTriggerStay(Collider other)
{
if (other.gameObject.name == "Bomb(Clone)")
{
BombGameObject.GetComponent<SphereCollider>().isTrigger = false;
Debug.Log(" stay ");
}
}
private void OnTriggerExit(Collider other)
{
if (other.gameObject.name == "Bomb(Clone)")
{
BombGameObject.GetComponent<SphereCollider>().isTrigger = true;
Debug.Log(" Exit ");
}
}
Regards
Pradeep