- Home /
Lightmap bug
I tried baking my scene, and my trees lost their shadows. So I cleared the lightmap. After that, the scene was still rendered with lightmap. I have tried unchecking the "Use lightmap" checkbox, but it does not do anything. If I press clear lightmap, the shadows come back, but when I press play, they're gone even in the editor until I manually clear lightmap again.
So far if I use UnityEditor.Lightmapping.Clear () in my script then the tree shadows are restored, however I cannot build my game. Unity throws me this error error CS0103: The name `UnityEditor' does not exist in the current context
Please help me solve this. Thank you very much!
UnityEditor should be linked at the top of the script as a namespace. You shouldnt need to reference it directly.