- Home /
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.
Answer by ilkin · Apr 17, 2014 at 09:07 PM
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.
Thanks, this fixed my problem as well. After a bit of testing, I came to the conclusion that it might have something to do with the billboard effect that the line renderer has. Perhaps, even though the camera is in ortho mode, and the billboarding should always be facing straight, there is some bug that causes that to break when the camera and the line renderer have the same value on the z axis.
Answer by TheGameLearner · Nov 22, 2018 at 04:45 AM
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.
Your answer
Follow this Question
Related Questions
Trouble downloading iOS Platform editor support 0 Answers
Highest Unity version that's compatible with ARKit Plugin (deprecated) for app store publication 0 Answers
Printing Distance b/w two points using line renderer and Raycast 1 Answer
Why are the physics different between the editor and device (iOS)? 1 Answer
where can I store txt files in the editor that I'm going to access in ios 0 Answers