- Home /
Replacing Sprites/Default shader
Im trying to replace the "Sprites/Default" shader with my custom one. I thought naming it the same would force Unity to use it. However it only works if I create a new Material, select the shader and assign it to each sprite manually. The default sprite material still uses the standard Unity sprite shader which should be overwritten.
Answer by PixelSpartan · Feb 14, 2017 at 04:57 PM
You cant do that, must set each to sprite manually if thats really a problem just multi select all the sprites and then select it.
Thats a pitty. I wanted to avoid doing it manually. If you are continuously building a level it would be easy to miss a sprite or two so they would have the default sprite shader
Answer by kskjadav007 · Apr 09, 2018 at 06:13 AM
try this
gameObject.GetComponent ().material=new Material (Shader.Find ("Sprites/Default"));
Your answer
![](https://koobas.hobune.stream/wayback/20220612110900im_/https://answers.unity.com/themes/thub/images/avi.jpg)