Collision Detection

Options

Hello, I'm making topdown PvP shooter and the collision detection doesn't work. I move both objects by using transform.Translate(). Both the player and the Bullet have colliders, photon views and photon view transform. The Bullet is also tagged "Bullet". I've tried turning the speed down, but it still doesn't work. I also added Debug.Log(), but nothing gets logged to the console, suggesting the function doesn't even work. I'm using this script to detect the collision and delete the bullet as well as subtract health:


void OnCollisionEnter2D(Collision2D col)

{

Debug.Log("Collision");

if(col.gameObject.CompareTag("Bullet"))

{

health -= 20;

PhotonNetwork.Destroy(col.gameObject);

Debug.Log("Bullet");

}

if(health <= 0)

{

//Died

avatar.SetActive(false);

}

}


I don't get any errors, but the bullet just flies through the player.