- Home /
How do I include baked lighting in my prefabs?
So I have a school hallway that I want to make tiled that heavily relies on a baked area light to look as good as it does. This is for an endless runner game I'm making. However, I need to turn the section into a prefab so I can generate an infinite amount for when I'm playing. When turning it into a prefab, it loses its lighting. How do I turn the object into a prefab while keeping its lighting?
I've tried using the tools on this link but I'm still so confused. https://forum.unity.com/threads/problems-with-instantiating-baked-prefabs.324514/page-5#post-2519284 I really need help
Answer by SolidSlish · Aug 07, 2019 at 01:20 AM
So the baked area light object is in the hall object along with the prefab. The hall object is basically a folder with the objects inside. Its a child. Am I not supposed to do that?
So to be honest, I already built a system that generates a variety of different prefabs in a straight line and connected. Since the hallways will each have variety to them, I need this system to randomly generate around 12 different hallways.
Anyways, I'm getting desperate and development on my project is halted due to this.
@SolidSlish Did you figure out how to add a lightmap to a prefab? I have the same issue...
Answer by starrtennis · Aug 07, 2019 at 01:16 AM
Where is the Baked Lighting object or property located? Have you tried adding it as a component to the prefab? Or what about as a child to the prefab? (Prefabs can have children.) I'm new to baked lighting and lighting in general so I'm just trying to get a handle on how this is all done.
In your image, it looks like the correct hallway is on the left and the dark one is on the right.
Are there other ways besides prefabs to generate an infinite hallway? Procedural generation perhaps?
mmkstarr
Answer by Giantbean · Sep 08, 2020 at 07:31 PM
Hope this helps. https://unity.com/how-to/advanced/optimize-lighting-mobile-games
Answer by Bentoon · Dec 15, 2020 at 12:17 AM
@SolidSlish lightbaking prefab tool: https://github.com/Ayfel/PrefabLightmapping
Your answer
Follow this Question
Related Questions
Problem with lights. Why is this happening? 0 Answers
Why is my scene dark without lightmaps even if I don't have any static geometry in the scene? 0 Answers
Issue while using shader for instantiating a baked-lighting prefab 0 Answers
How can I store and load levels efficiently? 2 Answers
Ugly green light when baking. 0 Answers