Hello!
I make a game where you control a spaceship and as you move, planets are appearing.
But when they Instantiate, they look like they have self-illumin material. This happens because the script that I use exept of keeping the r & g variables between 0-255 as to make a color combination, it makes them to >2000.
#pragma strict
var Earth : GameObject;
function Update () {
var n : int = Random.Range(0,1000);
var r : int = Random.Range(0,255);
var g : int = Random.Range(0,255);
if(n == 1)
{
var planet = Instantiate(Earth, transform.position, transform.rotation);
planet.renderer.material.color = Color(r, g, 0, 0);
}
}