Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Bug Fog working in editor but not in build

Discussion in 'Editor & General Support' started by uzisho, May 26, 2023.

  1. uzisho


    Jul 3, 2019
    3 days of trying to debug this :(

    2021.3 URP.
    Fog is working in the editor but is not working in a build.
    If the scene is being reloaded in the build - the fog appears... :eek:

    What I tried:
    1. Toggling fog off and on using a toggle (nothing happens)
    2. Preloading all shader variants for the fog
    3. Graphic Settings > Changing fog mode to manual

    Anyone ever experienced that?

  2. uzisho


    Jul 3, 2019
    Ok - solved it...

    To anyone who deals with that... in my case it was loading another scene on Awake which applied the light settings of that other Scene.
    Kurt-Dekker likes this.
  3. Kurt-Dekker


    Mar 16, 2013
    Thank you for coming back to post your postmortem update!

    This also gets into what is the current active scene, which is the one used for lighting, which of course in turn also controls fog.

    Here's more related ramblings about multiple scene setups:

    Additive scene loading is one possible solution:

    A multi-scene loader thingy:

    My typical Scene Loader:

    Other notes on additive scene loading:

    Timing of scene loading:

    Also, if something exists only in one scene, DO NOT MAKE A PREFAB out of it. It's a waste of time and needlessly splits your work between two files, the prefab and the scene, leading to many possible errors and edge cases.

    Two similar examples of checking if everything is ready to go: