I have problem with 2d game in unity. There is sprite named Player with box collider 2D, rigidbody, moving... There is another sprite with two box colliders 2D. First isn't trigger, second is trigger. This sprite has this code:
private void OnTriggerEnter2D(Collider2D other)
{
if(other.CompareTag("Player"))
{
Debug.Log("Player in range");
}
}
private void OnTriggerExit2D(Collider2D other)
{
if(other.CompareTag("Player"))
{
Debug.Log("Player left range");
}
}
This is player
This is game object
I need to make that player in range of that object. This is only for debug but it's not working. I don't have any idea how to fix it. I tried docs but I don't know, I'm beginner. Thanks for help.

unityscriptis or better was a JavaScript flavor like custom language used in early Unity versions and is long deprecated by now ... your code is clearlyc#- derHugo