Line Renderer Material not displaying correctly between Editor & Build

Hey guys,

I need the material for a line renderer I’m using to change between a solid and dotted line in certain situations, so I’m trying to swap out the material. Unfortunately, it doesn’t seem like the dotted line is working correctly in the build of the game, but works perfectly in editor.

This is the build version (bugged):

And this is the editor version (correct):

I’m currently using the UI/Default shader, which is rendered on the rest of the HUD, and I’ve verified through debug console in build that the line renderer settings like scale or texture mode aren’t being changed between editor and build.

I’ve tried to fix it by doing the following:

  • Swapping the dotted line material to use URP/Unlit. This renders the line renderer completely invisible in the build.
  • Adding both the UI/Default Shader and the URP/Unlit shader to the Always Include list. This doesn’t have any effect.
  • Ensuring both the solid (Active) and dotted (SemiActive) materials are referenced in a component in the scene like below:

Does anybody know what could be going on? Thanks in advance!