I have been trying to change the texture at runtime but whenever i attempt it the quad just goes pink:
After looking this up for a bit it seems that this happens because the material is missing but…
// Void Start()
Left =Resources.Load("Materials/Left",typeof(Material)) as Material;
//void Update()
if (velocity.x < 0){
GetComponent<Renderer>().material = Left;
}
I have also tried this:
//void Start()
Right =Resources.Load("Left", typeof(Material)) as Material;
To clarify, i have been using quads and all these materials have the “Sprites/diffuse” Shader.
What am i doing wrong, is it the code or something else? Hopefully i got my problem across.
Thanks