$begingroup$

I’ve a object with field collider that spins 360 diploma earlier than destroying itself. I’ve a whole lot of enemies spawning across the participant. The article spawns, spins and destroys itself. Think about it like scythe. However just some enemies are getting broken and a few will not be. The code is given under

 personal void OnTriggerEnter2D(Collider2D collision)
 {
     harm(collision.gameObject);
 }

 void harm(GameObject different)
 {
     if (different.gameObject.CompareTag("Enemies"))
     {
         //Damaging the enemy
         different.gameObject.GetComponent<Health_Enemy>().well being -= Harm;
         different.gameObject.GetComponent<Health_Enemy>().examine();
     }
 }
```

$endgroup$

You need to log in to reply this query.