Ayfel / PrefabLightmapping

Script for saving lightmapping data to prefabs. Used through the Assets tab in Unity. Place your prefbas in the scene with this script at the root. Set up your lighting and in the editor go to Assets->Bake Prefab Lightmaps. After is processed you can now spawn your prefabs in different scenes and they will use the lightmapping from the original scene.
655 stars 91 forks source link

Baked Objects Get Darker After Reloading Scene #22

Closed ImanTanumihardja closed 4 years ago

ImanTanumihardja commented 4 years ago

Hi, thank you for this script it has really helped optimize performance in my mobile game.

However, I am having issues with game objects appearing darker after the scene is reloaded. Do you know if this issue is caused by the script or maybe something else?

In the video, the cars become darker after I reload the scene (Ignore the dark buildings): ezgif com-video-to-gif

Before Reload: LightmapIssue

After Reload: LightmapIssue2

Any help would be greatly apperciated.

Ayfel commented 4 years ago

mmm I would make sure you are calling the Init() function on the prefablightmapping script, maybe the way the scene is reloading it is not calling that. You can manually call it from whatever script you have in the car on Start or similar. Let me know if manually calling that fixes it (you might have to make the Init() public)

ImanTanumihardja commented 4 years ago

Thanks for the quick reply. I will try it

Ayfel commented 4 years ago

Great : )