HI, I’m trying to make a grid of cubes 25x25 which I have, but I’d like every other cube to have a different color, like a checker board. This is the code I have so far which at least creates a floor of cubes:
using UnityEngine;
using System.Collections;
public class MainScript : MonoBehaviour {
public Transform cube;
public int gridWidth=25;
public int gridDepth=25;
//public int gridHeight=10;
void Start()
{
//for (int y = 0; y < gridHeight; y=y+2)
//{
for (int z = 0; z < gridDepth; z=z+1) {
for (int x = 0; x < gridWidth; x = x +1) {
Instantiate (cube, new Vector3 (x, 0, z), Quaternion.identity);
}
}
}
Thanks in advance.