I have some issues with detecting the collision when OnTrigger2d, as you can see in my screenshot below, that actually too far from the object.
this my script
private void OnTriggerEnter2D(Collider2D collision)
{
if (collision.tag == "Obstacle")
{
anim.SetBool("isDeath", true);
_GameManager.instance.GameOver();
}
}
private void OnTriggerExit2D(Collider2D collision)
{
if (collision.tag == "Obstacle")
{
anim.SetBool("isDeath", false);
}
}
```