I tried using this method but not in entry if. I want to know when the bullet hit the enemy from the enemy
void OnTriggerEnter2D(Collider2D colisor)
{
Debug.Log("Okay");
if (colisor.gameObject.tag == "Bullet")
{
Destroy(colisor.gameObject);
vida--;
Debug.Log("Okay2");
}
}