how to make the UI follow the camera and not the player

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By MohammadAjam

I ran into a problem while using the camera.
I set the limits for my camera but whenever I get close to the limit of the camera the UI gets out of the screen.
I tried to fix the problem by making the UI a child of the camera but that didn’t fix the problem. I tried to see if the UI also has a limit and I found nothing.
Is there a way to fix this

:bust_in_silhouette: Reply From: RandallCurtis

Place your UI as a child of a CanvasLayer node to essentially “pin” it to the viewport. See the relevant tutorial here.