- Home /
Save lightmap in prefab
Hello all - I got a problem with Unity 5. I used to bake lightmap and be able to apply the baking on prefab. The lightmap was saved with the prefab. Then, when instantiating a prefab, its lightmap would also instantiate. Not anymore with Unity 5. Even if a prefab is instantiated, then baked, then prefab saved, it will still be unbaked when re-instantiating ... Anybody ran in the same problem ? Thx ! Michel
Yes, we have the same problem. I just now finished program$$anonymous$$g a workaround for it. It's not pretty. Hopefully we didn't just waste a lot of time. We could not find any responses from Unity reps about this, only deleted questions about it. I was surprised when I looked again for the 10th time and found your question and it wasn't deleted, actually.
Never found a solution about it either. Since these baked prefabs were in small quantities in my project, I now simply keep them as baked objects in the scene, and reposition them as I need. Looks like baked prefabs are unfortunately not available anymore ...
Answer by garrett3d · May 13, 2015 at 04:42 AM
We're having this problem too, it looks like it's a known issue though. You can follow it in the issue tracker here:
http://issuetracker.unity3d.com/issues/prefabs-dont-store-ligthtmap-information-correctly
and vote it up!
Answer by Joachim_Ante · Jun 26, 2015 at 03:43 PM
Sample code for how to solve this: http://forum.unity3d.com/threads/problems-with-instantiating-baked-prefabs.324514/
Answer by Firedan1176 · Jul 28, 2016 at 05:54 PM
This is by design in Unity 5. Lightmap information was stored in the Scene file, as well as individual Renderers. However, this could cause issues. Therefore, the Lightmap Screenshot now stores all this information. Therefore, you'll need to manually do this via script.
Hi there, i couldn't find any information or provided such script. Can you please direct me somewhere if it's still manually being done via script? (and note that i've a basic script knowledge)
Your answer
Follow this Question
Related Questions
Create a terrain prefab? Saving a terrain? No? 1 Answer
List or Array of Custom Classes not saving into prefabs properly? 2 Answers
Lighting Mapping the hard way 1 Answer
Change scale in lightmap (Prefab property) by script 0 Answers
prefab when dragged on scene is not where its saved to be 1 Answer