How to enable a canvas when AI touches the player

I created a canvas with the text Game Over and I created AI that will follow the player. The Canvas is currently hidden in the game.
The problem is I am unable to figure out how to enable the canvas once the AI touches the player.

Hello there,

I would recommend adding a Canvas Group component to your canvas. Enable the canvas, set the Canvas Group alpha to 0. Then, once the AI touches the player, set the alpha of that component to 1 to make it visible. You can even do some fading of that alpha to have it feel a little smoother.

I hope that helps!