- Home /
Lines drawn with LineRenderer is covered up by other game objects regardless of sorting order/positioning
I've found countless posts around here with the same issue and I've tried everything I've seen listed in them. Any other ideas? No matter what I do, my line drawn by my line renderer renders behind EVERYTHING else in the scene.
I'm trying to draw a simple line in a 2D game based on touch. However I can't get a LineRenderer built line to show up period.
I'm just messing around with the completed scene from the 2D RogueLike tutorial, and I added an empty gameobject with a LineRenderer on it. I added a Material (Spirts/Default) to it. The Line has 2 points and (after quite a bit of messing around) now shows up perfectly fine in the "Scene" tab, however once the game starts it's behind everything in the actual "Game" panel and can't be seen.
I've tried changing the camera type, I've tried changing to sorting order, I've tried changing the Z coordinates of both the line itself, and the game objects in the scene. Nothing is working.
If I look at it in 3d the line looks like it's at a random awkward angle, but rotating it or moving it's transform position has no effect whatsoever.
Is your LineRenderer not showing up or is it being drawn behind everything?
I just did a quick test The $$anonymous$$aterial I used for LineRenderer uses Particles/Alpha Blended Premultiply shader and I just set its Order in Layer to be greater than whatever I need to show it over and it works fine.
Answer by k3nt741 · Aug 17, 2021 at 09:29 AM
Maybe a late respond but if I remember correctly I had such a problem before and to fix it I think I selected the canvas and changed the Render Mode to Screen Space - Camera.
Your answer
Follow this Question
Related Questions
Line Renderer disabled in the final build 1 Answer
Draw over using Line Renderer 2D when hitting a collider 0 Answers
[5.4 - Unity2D - Android] UI Button Requires Child Text? 0 Answers
Beginner Question Regarding Sprites w/Multiple Images 0 Answers
Bullet in editor does not behave the same in build. 1 Answer