Terrain Visibility Issue in Build Mode vs. Editor Mode - MapMagic2

Hello everyone,

I’m currently developing a game using Unity and I’ve run into a puzzling issue that I hope someone can help me with. In the Unity Editor, the terrain in my game displays correctly and everything looks as expected. However, when I build the game and run the executable, the terrain is completely invisible, although other elements are visible just fine.

Here are some specifics about my setup:

  • Unity Version: 2023.2.4f1
  • Rendering Pipeline: URP
  • Platform: Windows

Screenshots in Editor and Build mode are attached for reference.



Has anyone encountered a similar issue or does anyone have any idea what might be causing this? Any help or suggestions on what to check or try next would be greatly appreciated!

Thanks in advance

I’ve seen that before but can’t remember what it was. I think it was a terrain material shader that was made for BiRP and didn’t work in URP despite conversion. Try using a standard URP terrain shader / material perhaps.

You’re missing out on 15 patch (bugfix) releases. Slight chance you may have a better experience with 2023.2.20f1 in case this is/was an actual engine bug (unlikely but still good practice to be on the latest patch).

I upgraded to 2023.2.20f1 and verified the terrain material uses URP Terrain Lit but the issue still persists

Tracked this to an asset named MapMagic2, it seems if the scene is generated from scratch, meaning at least not a single main or draft tile pregenerated and saved with the scene before the build, the terrain would still generate but it would be invisible.

I wasn’t thinking this asset was the issue because I also tested it with a standalone terrain, but it somehow got affected by this asset.

Found the solution, written at the bottom of the post.

Sorry if this is not the right thread, but this is the most recent instance of a record of the Terrain not appearing in build, yet the rest of the game, and the terrain details, are all visible. My screenshots would be identical to the OP. Editor, and Editor Play-Mode: perfect. Build: Nothing.

I am using U6 6000.0.29f1, URP, Windows, LZ4 Build Compression
I’m finding a lot of the issues I find with it are related to 2023 editor issues/behaviour.

I do not have MapMagic, but I do have Gaea terrain editor installed. However I have not used it in any of the scenes with these non-working terrains. I also haven’t updated it in quite some time. I am not using any shaders or anything from it either.

There is a long running “fix” that involves unchecking “Draw Instanced”. This solved my problem in previous versions of the editor, 2021, but is also unchecked now. Upgraded from 2021 to U6.

I created a from scratch terrain in the scene, from this version of the editor, and disabled previous terrains with no change.

I see some issues related to addressables loading of scenes, but I am not using that method for loading scenes. Just regular Async load.

I created a custom Material using URP/Terrain Lit shader, like was recommended in those threads, but it did nothing.
https://www.reddit.com/r/Unity3D/comments/101imjq/desperately_trying_to_build_the_game_terrain/

I rebuilt my addressables packages. The only thing I’m using addressables for is UMA 2.

I cannot put URP/Terrain Lit in the “Always Include Shaders”.

I have tried disabling “strip unused shader variants” to assure ALL shaders are included, in case Terrain Lit is considered unused by all my terrains in every scene… Bricks my build.

I’ve uninstalled Gaea, Gena, and Sectr assets from the project. All based on level/terrain handling by Procedural Worlds, most now unused. Nothing.

I’m out of ideas.

Added:
Building a blank URP project, put a blank terrain in sample scene, building. Works.
Installing Cinemachine. Works…
Installing my vegetation instancing asset, restarting. Using their demo scene. Works
Installing Unistorm weather and time system. Works…
I’m not sure where things are failing.
Going to re-create my Render Pipeline Settings in project. Made blank URP Render Settings.
Changing URP Rendering Settings Took A Large Build Time. No Terrain.
Copying my Assets folder into the Blank Project… Missing things so it doesn’t actually function.

SOLUTION

In my scene loading sequence I have the content of the level disabled, including the Terrains, then activate the game objects and generate things once the scene finished loading.

By moving the terrains out of the root disabled game object and letting them load in with the scene they are visible