Search Unity

Script for creating grid

Discussion in 'Scripting' started by nooB, Nov 20, 2009.

  1. nooB

    nooB

    Joined:
    Oct 4, 2009
    Posts:
    20
    I need to drag and drop some items onto a terrain for which I would need to create soem rectangular grids.

    What should be the best way to create invisible multiple rectangle grids over a terrain grid?
     
  2. andeeeee

    andeeeee

    Joined:
    Jul 19, 2005
    Posts:
    8,768
    If the rectangles are all in the same plane, you can just align one corner of the terrain with the <0,0,0> world position and then divide spatial positions by the width of a grid cell to get the grid position.