- Home /
After loading new scene additively, new light probes not used.
Hey, I want to load scenes additively and use the baked light probes in there. Trying to find a solution to this problem, I stumbled upon that it was a bugs that is supposedly fixed: bug1 and bug2.
I also found this page that is on possible solutions but I can't get that to work.
In my script I have the following code:
SceneManager.LoadSceneAsync("level2", LoadSceneMode.Additive);
LightProbes.TetrahedralizeAsync();
but when level2 is load dynamic object still does only use light probes from level1.
Is that a bug? Am I missing something?
Interestingly, if I drag level 2 into the hierarchy of level 1, it doesn't work in the same way that it doesn't work if I load the scene in the script. In the examples this can be seen if the gameObject loadNextScene is deactivated but level 2 is dragged into the hierarchy of level 1. However, if I drag level 2 into the hierarchy of level 1 AND load it with the script, then the new light probes are used.
Here is an example project that illustrates the issue. The PW is unity.
For me it works to add this script to a gameObject in the to-be-loaded scene:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class updateLightProbes : MonoBehaviour{
// Start is called before the first frame update
void Start(){
LightProbes.Tetrahedralize();
}
}
Answer by Bunny83 · Apr 24, 2020 at 01:50 PM
Uhm I don't think your code would work this way. You load the level aynchronously. So it's not loaded yet when you start the "TetrahedralizeAsync" task. You should start the tetrahedralize task once the second level has finished loading.
Indeed if I create gameObject and attached a script that runs LightProbes.Tetrahedralize(); when I activate, it does work! Thank you