[Server]
void InstantiateMap(){
for (int b = 0; b < y; b++) {
for( int a = 0; a < x; a++){
GameObject toInstantiate = null;
switch(mapData[a, b]){
case 0:
toInstantiate = ocean[Random.Range(0,ocean.Length)];
break;
case 2:
toInstantiate = plain[Random.Range(0,ocean.Length)];
break;
case 3:
toInstantiate = forest[Random.Range(0,ocean.Length)];
break;
case 4:
toInstantiate = hill[Random.Range(0,ocean.Length)];
break;
case 5:
toInstantiate = mountain[Random.Range(0,ocean.Length)];
break;
}
Instantiate(toInstantiate, new Vector3(a, -b, 0), Quaternion.identity);
NetworkServer.Spawn(toInstantiate);
}
}
}
This is my code to instantiate a grid for a turn-based tactics game.
My problem is that despite the fact that I am spawning each and every tile, the map doesn’t show up in a test client; it’s all black.
How do I resolve this issue so the map appears when a client connects to the host?