Should we keep UI Canvas in Scene?
I hope META will be the right place for this question/request, sorry if I'm wrong.
So, I use Unity since 2014 and this is my favourite game engine, I'm almost totally fine with it, but there is some deficiency or things that annoy me.
The Vector3.zero position relative to Scene space is the centre almost all of my games, so I spend a lot of times there, and always annoy me the UI Canvas, because I can't move it, I can't hide it. It always starts at 0,0,0 and always obscure something that is important for me. I don't know why it should be in the Scene (I think the engine's other segments improved a lot since this UI solution, it need an upgrade in my view), I hope u guys will make a new platform for it, like for the Animator & Shader Graph.
The UI Toolkit might interest you.
I'm not sure it's ready for production since the package is currently in preview.
Remember that you can hide the canvas from the scene by clicking on the eye icon next to the object in the hierarchy.
Note: Don't expect anyone from Unity Technologies to see your post. Better post on the forum.
Thank you for your reply! I didn't hear about the UI Toolkit, but it especially looks like what I waiting for! I assumed that I won't get a reply from an engine developer, but what you said was helpful enough. (I know that I can hide the Canvas in the hierarchy, but then it's also hidden in game mode, the better option for me to hide it by the gizmos, but then I should frequently change between visible and invisible. I need a window that I can handle separately like the UI Toolkit you mentioned)
I know that I can hide the Canvas in the hierarchy, but then it's also hidden in game mode
You don't need to disable the object, you can only hide it in the scene
Answer by GetLitGames · 5 days ago
So first, Canvas can be screen space or world space.. but second, once you get used to screen space it's really useful. You anchor UI to left/right side of screen, or centered. Once you learn correctly building UI to stretch for different resolutions, you will see the usefulness of screen space. For Overlay Canvases, you should generally have "Scale with Screen Size" selected and Expand works well but I usually use "Match Width or Height" with the Height setting because we have widescreens are common. Get used to using a pattern where you create Canvases (you should have many) with an immediate Panel child that is Stretched full width and height, then maybe another Panel below that is the one you actually want to size to show a window or popup. That way you can add a Panel that blurs the background (the entire screen) or darken the background etc. But you will also notice that if you move that stretched Panel, it stays the same size of the full screen (the Canvas) but you can still move it around. If you create your own script that set's the transform to be Vector3.zero in Awake() and add it to that Panel then you can move those Panels around and work with them in the editor conveniently without them being ontop of each other or having to toggle things on and off constantly so you can see. You should be creating many Canvas with Panels.. and not just have one Canvas with everything in it.. Unity has to redraw everything when one element changes, as well as some other reasons.. Not for every little control, but you should have a pattern where you generally create multiple top level Canvas.
Your answer
Follow this Question
Related Questions
I can't use any UI elements in my Project 0 Answers
How to physics raycast through overlay UI? 1 Answer
Dragon Bones in Unity Canvas 1 Answer
UI image sorting trought depth/render queue? 0 Answers
How to find an UI button by name? 2 Answers