LineRenderer - Not Showing within Game

Hello,

I have a line renderer that IS showing within my Unity Editor window, but NOT in my Unity Game window. Not really sure why?

  • The line renderer is using the Toon Basic shader (although, even if I use a simple shader - still doesn’t show).
  • Makes no difference when I change the width, or manually change the Vector position of it.
  • My camera is an Orthographic.
  • It’s compiled for iOS

Not sure what the problem is at all - so I’m just naming anything it could have to do with it.

— Update —

Okay, so when I play the game with my line renderers on, it doesn’t show. But when I move my game camera slightly within the editor, the camera suddenly ‘sees’ the lines and then it works as expected. Might be a bug in the actual editor?

I’ll build to iPhone and see if it occurs there.

— Update 2 —

Nop! Doesn’t show in the build either… Only in the editor - or when I move the camera a little bit in the editor; it will then show in the game window, not sure if this is the same case for iOS.

I had the same problem today. I was trying to draw a line between my gameobjects.
When I changed the position.z of my game objects from 0 to 1 lines became visible on both the editor and the game view.
Hope this helps.

It’s late but maybe It will Help someone. If your Camera ‘sees’ the line renderer after moving, then it means that the line started from the center of the camera. In essence, you are looking at a single-sided polygon(line renderer). Now it can turn to ‘face’ the camera while maintaining a starting and end position, by rotating about its line axis to make itself visible to the camera. But when you are at an end point of the renderer, the single-sided polygon has no rotation that will enable the camera to see it.
My suggestion for anyone facing this issue, make the line renderer start from a point that is a little below the main camera.