Hi all,
So I’m currently wanting my instantiated object to have a random colour when it’s being created, so the code is like:
if (Input.GetMouseButtonUp (0) && !IsPointerOverUIObject ()) {
int r = UnityEngine.Random.Range (0, Center.Count);
centerPiece = Instantiate (Center [r], new Vector3 (0, 0, 0), Quaternion.identity) as GameObject;
Debug.Log ("R: " + red + " G: " + green + " B: " + blue);
centerPiece.GetComponent<MeshRenderer> ().material.color = Color.red;
}
But currently the object all appear to be white when they are instantiated, or else for some reason locked in a cmyk colour; i.e. when there is a colour being reproduced.
Is this a matter of problem with my code, or how I’ve set up my unity project…? Could any one give me a bit of help?