• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
78
Question by Caelorum · Mar 10, 2015 at 10:14 AM · c#lightingloadlevelapplication.loadlevel

Application.LoadLevel() changes lighting for some reason?

I'm making a very simple game. Basically after the play misses three object, the game will reload the scene he was just on.

So i would use Application.LoadLevel("_Scene_00");

However, for some reason whenever the game reloads _Scene_00, the lighting darkens dramatically. I'm using a directional light, and even after the scene change it is still in the same spot.

Before:

alt text

After:

alt text

applebefore.png (287.6 kB)
appleafter.png (328.4 kB)
Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image domiii · Feb 26, 2017 at 06:35 AM 0
Share

It appears, this error re-surfaces every few versions? Did not have any problems in previous versions, but in 5.5 it's screwed up. :( Good thing, disabling auto build, as mentioned below, fixes it.

12 Replies

· Add your reply
  • Sort: 
avatar image
119
Best Answer

Answer by Wolfdog · Apr 04, 2015 at 10:25 AM

After building the game, everything is working again, so no worries.

To fix it in the Editor, go to Window -> Lighting -> Lightmap Tab -> Disable Continuous Baking -> Press Build to bake the lighting once manually.

Note that if you add more lights or make some changes, you have to bake the lightmap again.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image williamsokol12 · Jul 16, 2016 at 12:23 AM 0
Share

If you were courious you have to do this for each level and have somewhere to keep the settings

avatar image
34

Answer by ScarredBison · Feb 29, 2016 at 04:12 PM

alt text

Window > Lighting > Other Settings. Turn off Auto and press Build.


unityproblem.jpg (102.5 kB)
Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image dennyroberts · Mar 27, 2018 at 02:35 AM 0
Share

FYI this just worked for me in 2017.3 (the suggestion in the top comment seems to be outdated).

avatar image SimRuJ dennyroberts · Apr 11, 2018 at 08:15 AM 0
Share

I tried it with version 2017.3.1f1 but it's still doing it as soon as I change the scene in the game view.

avatar image Sim_Mad · Jun 27, 2018 at 07:00 PM 0
Share

It works! Thank you!

avatar image
33

Answer by One Ring · Mar 11, 2015 at 11:37 AM

I'm having the same problem, it seems to be something to do with the global illumination, I have not found a fix, however the problem doesn't seem to impact the build, just playing in the editor. Trying building and running that, hopefully the editor will be fixed in a future patch or something.

Comment
Add comment · Show 5 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Caelorum · Mar 12, 2015 at 10:34 PM 0
Share

Yeah it actually works well in the build. Just really irritating when you are trying to test levels and the lighting goes out.

avatar image KitCoo · Mar 14, 2015 at 04:36 PM 0
Share

Just want to also say that While changing my settings in lighting and also depending on my sky box i had Different effects some times depending changing the sky box back to default it fixed my issues

avatar image el_santo · Apr 01, 2015 at 10:52 AM 7
Share

The fix is to go to Window -> Lighting -> Lightmap Tab -> Disable Continuous Baking -> Press Build to bake the lighting once manually. And now the lighting remains consistent. Original: http://forum.unity3d.com/threads/application-loadlevel-application-loadedlevel-resets-level-but-causes-light-intensity-to-change.308248/#post-2006396

avatar image dylanmog el_santo · Oct 13, 2015 at 10:15 PM 0
Share

This actually works but my scene is a little dark

avatar image ArnoC · Apr 28, 2015 at 03:23 PM 1
Share

There is a bug report filed for it http://issuetracker.unity3d.com/issues/loadlevel-ambient-gi-and-reflection-probes-not-loaded-if-continuous-baking-is-used-for-loaded-scene

avatar image
12

Answer by sr3d · Oct 29, 2015 at 11:25 AM

In both of your scenes go to Window --> Lighting --> Lightmaps and disable auto and manually click Bake. Leave the auto checkbox off. Do this for both of your scenes, the start menu scene and your game scene. In both scenes the auto checkbox must be off and have a lightmap snapshot up above in the lightmap snapshot field.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image chanfui · Nov 27, 2017 at 03:52 PM 0
Share

Thanks for the black magic... Need to apply for both scenes.. I always thought the Lighting setting is applied for all the scenes...

avatar image
5

Answer by helgewl · Sep 17, 2015 at 12:16 PM

In Unity 5.2.0f3, if you call DynamicGI.UpdateEnvironment() after scene has loaded in the editor, this will fix some of the missing GI. I have implemented this workaround in a persistent (DontDestoyOnLoad) MonoBehaviour:

 void OnLevelWasLoaded(int level) {
 #if UNITY_EDITOR && (UNITY_5_0 || UNITY_5_1 || UNITY_5_2_0)
     if (UnityEditor.Lightmapping.giWorkflowMode == UnityEditor.Lightmapping.GIWorkflowMode.Iterative) {
         DynamicGI.UpdateEnvironment();
     }
 #endif
 }
Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image helgewl · Sep 17, 2015 at 12:05 PM 0
Share

Actually, some scenes would still have render issues when loaded. I am now starting a co-routine that does a second DynamicGI.UpdateEnvironment() after WaitForEndOfFrame.

  • 1
  • 2
  • 3
  • ›

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

46 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Load level that was previously loaded! 1 Answer

Multiple Cars not working 1 Answer

Distribute terrain in zones 3 Answers

Application.LoadLevel(); not working 2 Answers

Image Effect lighting 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges