UI Canvas is enormous when used with a FPS camera.
I'm missing something fundamental about canvas settings and could use some assistance.
I'm trying to tie a canvas to a first person camera to act as a HUD. When I create the canvas it's huge, pushing UI elements out of frame. At first I thought the canvas was not displaying until I zoomed way out in the scene view. Here are some images to illustrate:
That tiny grey square is my entire level. The rectangular white box is the canvas and I've added some text in the center for testing. Here are the inspector settings:
Posts are limited to two images so I have to just describe the object hierarchy:
Player > Camera > Canvas > Text
I've played around with the hierarchy and inspector settings to no avail. The tutorials and documentation I've found suggest this should just work so I think I'm missing something basic. Any suggestions or solutions would be greatly appreciated :)
I am facing the same issue. Any help would be great!
Answer by michael_house · Jul 03, 2017 at 02:24 PM
Don't worry about how big it looks in the scene view. It only matters how it looks in the camera view. The scene view displays objects based on their size in the inspector, however the canvas is using pixels for it's size. This causes the UI to be shown as hundreds of thousands of in-world units large, but it's really just hundreds or thousands of pixels large, which is totally reasonable.
Switch to 2d mode (little button at the top of the scene view) and double click your canvas in the hierarchy. That'll show you your UI neatly and you can edit it as it will show on screen.
Thank you for taking the time to look at my question.
I was assu$$anonymous$$g there was something more wysiwyg but I can work with it as you describe. Double clicking for focus is a nice tip.
Your answer
Follow this Question
Related Questions
Having constant trouble with Unity's inbuilt UI system. 2 Answers
How to make a health script for a custom health bar (In A Canvas)? 3 Answers
Unity 5 buttons not interacting within a nested canvas 1 Answer
Having Trouble with Multiplayer Health Bar 0 Answers
Unity CanvasGroup's alpha is set to 0 when Instantiate 0 Answers