Question by
alan-c25 · May 28, 2020 at 12:40 AM ·
destroyenemydestroy objectdestroygameobject
Bullets not destroying enemies
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
Comment