Please forgive my ignorance, as I’m not a programmer.
What I’m wanting is the level starts with a random background color each time the scene is loaded.
I have a gradient background color that is blue that fades to black, but what I want is the scene to load with a different gradient each time.
For example in the picture below, I’d like to select 5 or 6 different colors for the “Color Top” color.
Each time the scene loads, it will choose from those 5 or 6 colors.
It’s going to be hard if you are not a programmer. Attach this script to the same object that you show on the picture.
public class BackgroundController : MonoBehaviour {
public Color[] colors;
//set the colors in the inspector
void Start() {
MeshRenderer mr = GetComponent<MeshRenderer>();
Color c = colors[Random.Range(0, colors.Length)];
mr.material.SetColor("ColorTop", c);
//ColorTop may not work if the name of the color in the shader is different
//it could be _colorTop or colorTop or something entirely different
//you can check the exact name if you look at the shader code
}
}