I'm going crazy, I have enemies flying along waypoints named and tagged as "Enemy" (i've tried by name and tag)
my bullet code can knock them but doesn't destroy them.
Bullet code is the following:
public class bulletScript : MonoBehaviour
{
private void OnCollisionEnter(Collision collision)
{
Debug.Log(collision.gameObject.name);
if (collision.gameObject.name == "Enemy")
{
Destroy(collision.gameObject);
}
}
}
Someone please help
↧