Search Issue Tracker
By Design
By Design in 2023.2.X
Votes
1
Found in
2020.3.38f1
2021.3.9f1
2022.1.15f1
2022.2.0b7
2023.1.0a10
2023.2.0a1
Issue ID
UUM-13267
Regression
No
Baked lightmap is removed when entering play mode.
Reproduction steps:
1. Open the user’s attached project
2. In the Hierarchy window, right-click “Cube_Lod0” > “TestSetLod”
3. In the Inspector, observe that Lightmap is added to “Cube_Lod0” GameObject
4. Enter Play Mode
Expected result: Lightmap remains on the “Cube_Lod0” GameObject
Actual result: Lightmap is removed from “Cube_Lod0” GameOject
Reproducible with: 2020.3.38f1, 2021.3.9f1, 2022.1.15f1, 2022.2.0b7, 2023.1.0a10
Reproducible on: Windows 10 Pro 21H2
{code:c#}
[MenuItem("GameObject/TestSetLod")]
static void TestSetLod()
{
int index = 0;
Vector4 v4 = new Vector4(0.7555f, 0.7555f, -0.00306f, -0.00306f);
GameObject go = Selection.activeGameObject;
MeshRenderer mr = go.GetComponent<MeshRenderer>();
mr.lightmapIndex = index;
mr.lightmapScaleOffset = v4;
}
{code}
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Out-of-bounds memory access with multiple CanvasRenderers under a Canvas when using Mesh API
- Inspector tries to access file after it was deleted when the file was locked in Inspector window
- Changing Transform values in Search window Inspector loses focus while dragging and stopping mouse without releasing dragging action
- Saving changes on the dirty VFX Graph during the Play mode throws "The referenced script (Unknown) on this Behaviour is missing!" warnings
- VFX Graph Debug Info overlaps the "Initialize" block debug info by default
Resolution Note:
As the lighting data is bound to the scene through the LightingDataAsset, changing the lightmap through the API like this does not serialize the data in the LightingDataAsset. This is by design, as we need to maintain the integrity of the LDA and only explicitly serialize it (as opposed to implicitly doing so as in this case).
Resolution Note (2023.2.X):
As the lighting data is bound to the scene through the LightingDataAsset, changing the lightmap through the API like this does not serialize the data in the LightingDataAsset. This is by design, as we need to maintain the integrity of the LDA and only explicitly serialize it (as opposed to implicitly doing so as in this case).