- Home /
Line Renderer does not work with orthographic camera?
Hi all,
I have a graph UI I created with NGUI. I then draw points on the graph and connect the points using lines created with Unity's line renderer. My code works as expected and the lines draw connecting the points, BUT only in scene view do the lines display. The game view does not display the lines and I can't figure out why. I'm using a self illuminated single color diffuse shader as the material for the line renderer. The camera does not have occlusion culling on and is set to render the layer that the lines are being drawn in.
The odd thing is that if I rotate the camera about 10 degrees along the y-axis then the line becomes visible in game view. This is extremely weird and so I ask : is the line renderer simply not set to work with an orthographic camera with a rotation set to 0?
Any help or feedback is appreciated. Thanks!
Hi actual i'am working with a line renderer in a 2D scene with a orthographic camera with rotation (0,0,0). It works fine. Could you post your code for drawing the line renderer?
I deleted it all at this point. I bought a package off of the Unity Asset store that performs great! Please see below, and thanks for the comment regardless.
Answer by stingman · Jan 25, 2015 at 10:39 PM
This is not an answer to the problem, however it is an alternate solution. I found a package on the Unity Asset Store called Vectrosity. I'm about to go back and leave a 5 star review because the asset is simply incredible. Leaps and bounds above Unity's default line renderer. I'm simply amazed at the work and quality of the product. I highly encourage anyone looking to do something similar to buy this package. Probably one of the best packages I've bought off the asset store. Much more efficient than the line renderer and the possibilities are much greater. I was able to create a continuous line throughout my graph with color changes, welding and dynamic changes very easily. The package is probably not suited for beginners, but it has great documentation.
Answer by sami1592 · Jan 25, 2015 at 10:26 PM
It could be that because how line renderer works. According to line render manual "The Line Renderer does not render one pixel thin lines. It renders billboard lines that have width and can be textured." So if your camera is too far from the line renders you may not see it. Angles can play a roll to. I just checked and line renders do work in orthographic mode.
i did not provide a solution, but tried to shed some light on the matter
Your answer
![](https://koobas.hobune.stream/wayback/20220613181417im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Keep Aspect ratio/Letterbox and maintain pixel perfection 0 Answers
Trying to use an orthographic camera in interior scenes 0 Answers
Changing Ortho Cam Size according to resolution 4 Answers
Keeping two objects in frame 1 Answer
Constrain a GameObject's movement to an orthographic camera's viewport bounds 4 Answers