lightmap-switching-tool icon indicating copy to clipboard operation
lightmap-switching-tool copied to clipboard

Mesh hash uses GetInstanceID, which changes after unity restart

Open MoonmonsterBrian opened this issue 10 months ago • 2 comments

In the LevelLightMapData script, it tries to find the renderer based on the hash of the transform, gameobject name and hash. In Unity 2022.3.50f1, GetHashCode() on a mesh returns the instance ID. This value does not persist properly. This means that lightmap data is not applied to any of the meshes.

We've solved this locally by removing the mesh hash altogether, as we don't see much use for it. Perhaps changing it the hash of the mesh name would be a suitable alternative?

MoonmonsterBrian avatar Dec 04 '24 14:12 MoonmonsterBrian