I’m pretty new at Unity and I was wondering if there was a way to attach UI elements to the camera. So if the camera moves the UI element would still be in the same place. For example, I’m making a game which is 3D Tic Tac Toe. And you can rotate the camera around the Tic Tac Toe board. I would like to create a screen that shows the player who won regardless if the player is still moving their camera around the screen.
Have you tried making it a child of the camera?
In tutorial’s page, at the very beginning of the ball lesson or the 2D game lesson the video explains a script to attach any text to the camera.
The script itself makes the camera follow the player and the text follow the camera at same time but you can easily extract those camera-text lines if you don’t want the player-camera work.
Every text you have in Unity (or other UI elements) are displayed under a ‘Canvas’. Without it, they won’t work. Since the Canvas is linked to the Camera, every move you do to the Camera, will affect the Canvas. So if you display a text at (0,0,0), it will be there regardless the camera position or rotation is.
Hope it solved your question.