Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.

    Read our full announcement for more information and let us know if you have any questions.

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: