I have a number of cubes and the top rows block ID is 1. I want to modify each cubes colour by a random amount to make the floor look more interesting however using my script I get these wierd lines of certain colour everytime.
using UnityEngine;
using System.Collections;
public class Block : MonoBehaviour
{
public int BlockID;
public int BlockHealth;
System.Random r = new System.Random();
void Start()
{
if(BlockID == 1)
{
int g = r.Next(0,10);
this.renderer.material.color = new Color(Color.green.r, Color.green.g + g, Color.green.b,1);
}
}
}