(UPTADE) I am developing a 2D Topdown Rpg Game. I have a problem with trigger colliders. I have button which make active an object and ı use it like Hitbox when i press button ı destroy enemy if it is touching hitbox but there is a problem about something. When i press button enemy is destroyed if only enemy is moving when it stop i cant destroy it
How can I fix this?
This is my hitbox's destroy script
private void OnTriggerEnter2D(Collider2D other)
{
if (other.tag == "Enemy")
{
Destroy(other.gameObject);
}
}
```