Search Unity

Materials not working until selected in the inspector

Discussion in 'General Graphics' started by thefreik, Jan 10, 2020.

  1. thefreik

    thefreik

    Joined:
    Sep 9, 2016
    Posts:
    4
    I'm having an issue with some of the materials in my game. They used to work but suddenly they don't, any changes I do requires me to select the model and then the material in the inspector for them to work properly. I've tried making a script that does this at runtime for me... but there must be a better solutions, problem is I honestly have no clue what's going on..

    Thanks in advance for any help XD
     
  2. John_Leorid

    John_Leorid

    Joined:
    Nov 5, 2012
    Posts:
    651
    Same here - the problem is, it also shows up in the build.

    In my case, I am copying a material (with instantiate, but also tried
    new Material(matToCopy);
    ), so it is a runtime material / temporary material.

    It shows up as if the shader isn't loaded. The inspector wasn't showing up until I removed the SubstancePainter plugin.
    The material is just pure cyan until selected in the inspector (which is not possible in the build exe)

    Using Unity 2020.1.17f1 with HDRP Version 8.3.1.
    I was not able to reproduce it in an empty project.