Line Renderers Not Appearing in WebGL Build

Hey everyone, I’m working on a webApp where I draw a bunch of lineRenderers to make a bunch cool shapes (see image). In the editor these always show up without issue, but later when building it seems the browser doesn’t want to render these lines. After testing my page across FireFox, Google Chrome and Microsoft Edge, it seems only Edge is willing to make them appear. Is there anyone who could tell me why this is the case or what I can do to make my lines appear on Chrome too?

Below are some things I’ve already tried with little succes:

  • Set lineRenderer shader from color/unlit to URP color/unlit (No effect)
  • Disabled lineRenderer.material.color changes in script (No effect)
  • Tested WebApp through Github.io and itch.io pages, aswell as local python server
  • Decreased line pool to only 10 lines (No effect)

Useful info:
At the start of the scene I make a pool of lineRenderer objects (all p1(0,0,0) and p2(0,0,0), then I take the first line out of that pool, remove it, change its point positions and add it back to the pool at the end. This proces repeats evertime a line needs to update.


Not all browsers are created equal

Check the browser console for any log messages.

Try testing with all postprocessing disabled (if you use postfx). See Camera Inspector and untick the postprocessing checkbox.

Try with a very simple test case, empty scene, just a line renderer with default settings, then build & run that. If this shows up, you know it’s something between the defaults and your settings, materials, or code.

Although Edge really is just Chrome with a different UI. Makes me wonder what technical differences these still might have that could cause this.

1 Like

My guess would be something along the lines of memory used generating the lines

Thank you very much for the suggestion, when building another scene with a simple LineRenderer things seem to be fine. I’ve tested out a few things and I fear the problem may indeed be the memory usage in calculating where the lines should be. I’ll have to rework my scripts somehow :slight_smile: