Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • 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
1
Question by oatssss · Mar 23, 2016 at 12:14 PM · scene-loadinglightmapadditive

Additive Scene Loading w/ Lightmaps - Lightmaps disappearing after calling SetActiveScene

I want to instantiate an object into a scene that has been asynchronously additively loaded by the scene manager ( SceneManager.LoadSceneAsync() ). I found SceneManager.SetActiveScene(Scene) which apparently returns false if the given scene hasn't been loaded yet so I thought I'd throw it in a coroutine to just repeatedly set the active scene until it has been loaded. Something like this:

 ...  
   
 SceneManager.LoadSceneAsync("World", LoadSceneMode.Additive);
 StartCoroutine(SetSceneActiveDelayed(SceneManager.GetSceneByName("World")));  
   
 ...
 
 IEnumerator SetSceneActiveDelayed(Scene scene)
 {
     while(!SceneManager.SetActiveScene(scene))
         { yield return null; }

     // Can do my instantiation here
 }

However, I found that if I do this repeated check via setting the active scene, the scene that gets loaded in becomes washed out and everything is just fully bright:

OSX Standalone (unexpected result) Washed out/full bright on standalone mac player

It's the same whether it's an async load or not. What's weird is that when run from the editor, it works perfectly fine as long as there were no lights in the originating scene. If there were, the scenes fall back to real-time lighting using both the lights in the original and the loaded scene.

Editor when loaded from scene with lights (also unexpected result) alt text

Is this supposed to happen? How should I find when an asynchronously additively loaded scene has been fully loaded in? I tried OnLevelWasLoaded but found that it wasn't getting called.

screen-shot-2016-03-21-at-63350-pm.png (396.1 kB)
screen-shot-2016-03-21-at-62212-pm.png (259.2 kB)
Comment
Add comment · Show 2
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 oatssss · Mar 22, 2016 at 01:24 AM 0
Share

Hmm, I tried using AsyncOperation.isDone for the check ins$$anonymous$$d and it seems that what's causing the loaded scene to go full white is the action of making the scene active once it's loaded.

AsyncOperation.allowSceneActivation also does not do anything when set to true for an AsyncOperation returned by the Scene$$anonymous$$anager.

avatar image KEMBL · Jun 13, 2016 at 05:51 PM 0
Share

Do not forget to make Scene$$anonymous$$anager.SetActiveScene(loadedscene) AFTER the one frame after scene becomes loaded and bake empty lightmap in the first scene where you load your scene additively. similar info: http://forum.unity3d.com/threads/scenemanager-loadscene-additive-and-set-active.380826/#post-2479577

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by FairGamesProductions · May 20, 2017 at 09:15 PM

Have you found a solution to this? I am having the same problem only for me it works well in editor, but the scene goes dark in the build.

Comment
Add comment · 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

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

6 People are following this question.

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

Related Questions

Modify Scene origin before loading scene? Or LoadLevelAdditive @ certain world position 0 Answers

LoadLevelAdditiveAsync progress is always 0 2 Answers

How to wait for baked lighting to load when using LoadSceneAsync? 0 Answers

How to access objects in another scene loaded in additive? 0 Answers

AsyncOperation for SceneManager.LoadSceneAsync doesn't adhere to Application.backgroundLoadingPriority 1 Answer


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