The problem here is that the line renderer is on top and there is seemingly no way for me to put the lines under the map icons but over the background UI.
Also the Mask component on the background isn’t affecting the line renderers…
Three (3) primary ways that Unity draws / stacks / sorts / layers / overlays stuff:
In short,
-
The default 3D Renderers draw stuff according to Z depth - distance from camera.
-
SpriteRenderers draw according to their Sorting Layer and Sorting Depth properties
-
UI Canvas Renderers draw in linear transform sequence, like a stack of papers
If you find that you need to mix and match items using these different ways of rendering, and have them appear in ways they are not initially designed for, you need to:
- identify what you are using
- search online for the combination of things you are doing and how to to achieve what you want.
There may be more than one solution to try.
Additional reading in the official docs:
And SortingGroups can also be extremely helpful in certain circumstances:
I found a solution! The “UI Extentions” library has a UI Line Renderer in it.
Awesome… that is gonna be a LOT better for your use case I think. It will make it much easier to get the anchoring / scaling correct.
Make sure you fiddle with screen aspect ratio as you develop to keep things flowing the way you intend.
Here are some notes on UI Anchoring, Scaling, CanvasScaler, etc:
Yeah, I’m pretty experienced when it comes to UI generally so I’m aware of all of these, thank you though!
This is what the result looks like by the way!