How to put Sprite-Default material to LineRenderer with code ?

Hello all,

I just want how can I found the right pathway to found the right emplacement of the Sprite-Default material with code ? ( I want to assign it to every line who are generated in a array when the script is executed so I cannot put it manually on the inspector ).

Thanks a lot.

You can create any Material you want in the editor.

You can drag it into a public field on a script.

You can also drag in Renderer components into that same script.

Using the Renderer reference you can assign the Material to the .material slot on the Renderer.