Search Unity

Simple picture for how to generate a hexagonal grid

Discussion in 'Community Learning & Teaching' started by Boogz, Dec 16, 2014.

  1. Boogz

    Boogz

    Joined:
    Dec 9, 2014
    Posts:
    42


    Coding Process:

    1. Create a new "Mesh" class object (Let's call it myMesh)
    2. Create data structures to hold the grid data (vertices array, normals array, and triangles array
    3. Populate your Mesh object with the data (myMesh.vertices = "vertices array", myMesh.normals = "normals array", etc)
    4. Generate an empty object, and populate it with a collider, renderer, and Mesh filter.
    5. point your "MeshFilter.mesh" to your myMesh object
    6. Assign a material and texture to your Mesh renderer
    7. Attach your script to the empty object
    8. Input your hex grid's variables in the inspector
    9. Click play
     
    Last edited: Dec 16, 2014
    Dantus likes this.