How can i show a image when the player enter a collider? (2D)

I tried a lot, but it just doesn’t work.

Here’s the script:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class OpenImage : MonoBehaviour {

    [SerializeField] private Image customImage;

    void OnTriggerEnter2D(Collider2D other)
    {
        if (other.CompareTag("Player"))
        {
            customImage.enabled = true;
        }

    }

    void OnTriggerExit2D(Collider2D other)
    {
        if (other.CompareTag("Player"))
        {
            customImage.enabled = false;
        }

    }

}

hey;
your code is ok;
can u show some screen shot from editor of your player object and collider object too maybe there are some thing wrong there;