x


Keep 2D tiles generating when player reaches edge of tiles already generated

void Generate() {
    for (int i = 0; i < 20; i++) {
       for(int j = 0; j < 20; j++) {
         clone = Instantiate(grid,new Vector2(i*tileWidth, j*tileHeight),Quaternion.identity)as GameObject;
         clone.renderer.material = tiles[Random.Range(0,tiles.Length)];
       }
    }   
}

I have a grid generating and I make the material random. How do I keep that grid going when I get to the edge of what is already generated? Also, another small question is it possible to change material at runtime?

more ▼

asked Feb 12 '12 at 11:25 PM

SYNYST3R1 gravatar image

SYNYST3R1
1 11 12 14

(comments are locked)
10|3000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1039
x819
x99
x57
x36

asked: Feb 12 '12 at 11:25 PM

Seen: 491 times

Last Updated: Feb 12 '12 at 11:25 PM