Search Unity

Quick Grid Question

Discussion in 'Getting Started' started by DocJ, Feb 17, 2017.

  1. DocJ

    DocJ

    Joined:
    Dec 9, 2016
    Posts:
    98
    I've learned how to generate a grid using 1 prefab 3d tile. I was wondering if it's possible to create a grid using multiple 3d tiles and placing them where I want them to be placed?

    Thank you in advance for any help.
    Doc
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Sure. Make a prefab of your tile, and then drag it in multiple times, arranging them however you like.
     
  3. DocJ

    DocJ

    Joined:
    Dec 9, 2016
    Posts:
    98
    Thanks Joe. I kind of thought that might be the way I have to do that. Can I then assign them positions in an array?
     
  4. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Yes, you could have a script on some sort of game manager object, with a public array of GameObject (or whatever other more specific type you like). Then you could drag the objects in the scene, into the array on this manager object.
     
    DocJ likes this.
  5. DocJ

    DocJ

    Joined:
    Dec 9, 2016
    Posts:
    98
    Thank you for the tips. I'll have to research how to do those things, as well as recheck the tutorials in case I missed that in one of them.
     
    JoeStrout likes this.