I would like to add some offsets to my points in my grid but I don’t know how. I made it where it had to generate a grid full of cubes from the center but ever since adding that I am unable to figure out how to implement the offset part, I’m trying to do this in the pic.
Example Pic:
[120022-crap.png*_|120022]
Code:
public class Grid : MonoBehaviour {
public Vector3[] points;
public int xSize = 5;
public int zSize = 5;
public float offset = 1;
// Use this for initialization
void Start () {
points = new Vector3[zSize * xSize];
for(int i = 0, z = 0; z < zSize; z++)
{
for (int x = 0; x < xSize; x++, i++)
{
points *= new Vector3(x - (xSize / 2f), z - (zSize / 2));*
print("There are " + points*);*
}
}
* }*
private void OnDrawGizmos()
{
Gizmos.color = Color.black;
for (int i = 0; i < points.Length; i++)
{
Gizmos.DrawSphere(points*, 0.1f);*
}
}
// Update is called once per frame
void Update () {
* }*
}
_*