Bug on Line Renderer

Hello,

I need to implement a scrollable map area where to draw connected points and I’m using the Line Renderer in order to paint lines to connect the different points.

Since I’m working with Unity UI, I can’t use the mask system to work with Line Renderer, so I’m calculating when there is a collision of the lines with the border in order to paint the lines inside the area.

The main problem is that it seems that it works only when I go into the “Scene” tab instead of the “Game” tab and that doesn’t make any sense.

I’ve made a short video showing the issue:

Before you suggest this, I can’t update to the latest 2019.x Unity because my project is based on Google Cardboard and the same code doesn’t work on that Unity version. I’m working on 2018.3.6.

Any help would be appreciated.

Thanks.

looks like you are using a perspective camera and the Z-value of the line is not the same as when on the “surface”. You do not see this in the scene view because there you have “2D” selected which renders your scene view with an orthographic camera.

did you check the points of the line renderer in the inspector?

PS: are you aware that there is a UI Line Renderer in the UIExtensions project?