Now that terrain is supported on Unity android, I’ve been working on a project. When I manually created my terrain, everything worked perfect both on computer and android.
I switched to dynamically generated terrain, and populated the terrain with splatPrototypes. It works perfectly on the computer, but on android the terrain is simply solid black. I am thinking perhaps this has to do with not having a Basemap texture? I can’t seem to find a way to apply it in the code. Or maybe there is some other issue that I am missing. Any suggestions would be welcome.
I have included the section of code where I attach the textures:
// add terrain textures
var splats = new SplatPrototype[1];
splats[0] = new SplatPrototype();
splats[0].texture = Resources.Load("grass");
splats[0].tileSize = new Vector2(15,15);
splats[0].tileOffset = new Vector2(0,0);
myTerrainData.splatPrototypes = splats;
var myTerrain = Terrain.CreateTerrainGameObject(myTerrainData);
myTerrain.transform.Translate(-terrainRes/2,0,-terrainRes/2);
I’ve tried using EDT texture compression instead of the default but that hasn’t helped.
Thank you for posting this work around. I was having the exact same problem, except for on a PC build. I am creating and texturing my terrain through a script. Everything would work perfectly fine when I would play the game from the editor. However, when I would build the game and play it, the terrain and terrain details would be completely black. Adding a single terriain manually, and giving it a texture and a detail grass with texture fixed it all for me.
– ThePilgrim