Let’s start with
Tile problem
var tile:GameObject;
var grass:GameObject;
var grass2:GameObject;
var sizeX:int;
var sizeZ:int;
function Start ()
{
for(x = 0; x < sizeX; x++)
for(z = 0; z < sizeZ; z++)
{
Instantiate(tile, Vector3(x,0,z), tile.transform.rotation);
Instantiate(grass, Vector3(x,0,z), grass.transform.rotation);
Instantiate(grass2, Vector3(x,0,z), grass2.transform.rotation);
}
}
So that’s the script for loading tiles (Tiles are ground, on which player is moving around) Now, I’d like to have some height differences on ground. Now it’s whole ground just flat, like you can see from the script. How this could be done? Do have some height differences on map.
I try to explain what I mean with this:
Now the tiles are like this
|xxxxxxxxxxxxxx|
|xxxxxxxxxxxxxx|
and this is what I’d like to have with random in some points in this SizeX x SizeY area:
|xxxxxxxxxxxxxx|
|xxxxxxxxxxxxxx|
|xxxxxxxxxxxxxx|
|xxxxxxxxxxxxxx|
So just basicly, higher tiles randomly put on this SizeX x SizeY area along with those normal tiles.
Grass problem:
As you can see from previous code it loads a grass too in those tiles too. Well, this is REALLY slow as it loads a plane with grass texture on it and then copies it on sizeX x sizeY area (on same area than tiles). TWO times… As grass2 is the plane with grass texture but just turned around. Because grass1 would be only able to see from other side without it. What I’d like to have is a little bit grass there and here, not on every tile and maybe a faster way of doing it?
Thanks!
PS. I don’t have money for PATileTerrain so it’s out of question.
[EDIT] This software made those look stupid, but basicly it’s a normal tile and then this higher tile I want to be there too randomly.