Quad Color Not Changing Even Though Material Does

Before I even get into it I’ll just put it out there that I posted this question on answers.unity3d.com (the unity version of stackoverflow) but it doesn’t seem like a lot of questions get answered relative to the amount of questions asked (I could be wrong), and questions also have to get approved (2-sided blade).

The rest is copy and pasted from it
Now, I might be missing something incredibly obvious, but I can’t seem to figure out why I can change the color of a material on a quad via script and the change will be visible in the inspector on the sidebar, but the quad itself remains black.

I can’t figure out why the quad remains black if the color is supposed to be red. The quad and material are all created via script, and I can show code if necessary.

I’m pretty sure the standard shader won’t render the albedo pass without a texture selected. Have you tried using a blank, white image as a texture so it can tint that? I’m not 100% sure on that but worth a shot.

Also, what’s the lighting setup like? Is it possible you just can’t see the quad?

For some reason my previous reply didn’t get sent.
The lighting is fine, because if I add in a quad via inspector and give it a red material via inspector it works.

I don’t like asking for code because I don’t learn much and it’s annoying for the other person, but could you please write the code that will create a blank white texture and attach it to the material? I’ve already seen this type of solution on Google but have been unable to actually create the blank texture.

If you are feeling extra nice, perhaps you could explain what each line does?

Ok, I am extremely angry, because this is the saddest mistake I ever made in my life (I’ve made many). When I created the quad in the script and set it’s scale, I ignored the z value and only put in an x and y value, assuming the the default value Unity would put would work. Turns out it didn’t. I added a z value of 1 and it works.

That’s a whole ton of hours of my life wasted. Thanks for trying to help.

6 Likes