Anchor the UI compared to a game object ?

Hello !

I’m beginning on Unity, and I’m actually realizing a Pacman game. I have some trouble with the UI, they are anchored to a canvas, but it doesn’t prevent it from overlapping with the game maze when I change the resolution.

A screen of my Scene and the hierarchy :

So the characters, points and the maze are in the Grid, while the Canvas is separated, bound to the camera. How can I make it so when changing resolution, The UI elements always stay in the area between the edges of the maze and the edges of the camera ?

Thanks you !

Basically you have to design your UI in relative size and anchor it to the screen corners. Check this Unity tutorial on how to do it: Redirect to... title of new-page