Making image appear on trigger

Hey guys, I’ve been trying to make an image appear when I collide with a trigger.
I’ve added an Image UI component and even written a script to make it appear, but the image instead replaces my player character. I have had no clue why this is happening, I hope one of you could help me out.

private void OnTriggerEnter2D(Collider2D collision)
    {
        if(collision.tag == "Collectible")
        {
            cherries += 1;
            cherryText.text = cherries.ToString();
            memoryText.text = "Sample Text";
            customImage.enabled = true;
        }
    }
    private void OnTriggerExit2D(Collider2D collision)
    {
        if(collision.tag == "Collectible")
        {
            memoryText.text = "";
            customImage.enabled = false;
        }
    }

Don’t see anything here to say it would be replacing, so without actually seeing what is happening I’m guessing instead what is happening is the image is overlapping your player and obscuring them. I would say while playing the game, and you have the image up seemingly replacing the player, manually select the image object and disable it and see if your player is still there. I suspect they are.

if that is the problem, it is because UI images are by default on the uppermost layer so they will do that unless you specifically alter their layer sorting. If this isn’t the problem, then there must be some other code involved here.