LightmapIndex not setting

Hi, I’ve creating some assets that blend with the terrain. Its all working perfectly now apart from the lightmapping when I press play. Below is the cliff I’ve created and blended with the terrain. I’ve set its uv2s to the terrain hits, and set the lightmapindex and lightmapscaleoffsets on the renderer to match that of the terrain, and all works great.

When I hit Play, the baked lightmap settings all get cleared on the cliff object and the object isn’t lit correctly anymore.
I’ve tried setting the lightmap indexes and offsets again at runtime and check the uv2s and they’re still exactly the same, but it all seems to be offset incorrectly, even though it looks like its potentially using the correct lightmap, as you’ll see here:

If I regenerate the entire mesh in Play mode it works and sets everything correctly again, which is obviously not a good solution.

So, is there anything additional I need to do to get that lightmapindex saved before building?
Also any ideas why if I reset the index and offset at runtime without rebuilding the whole mesh, its producing those weird results above?
Many Thanks!

So I figured out the second question, the mesh is getting batched and all uv’s reset in the batched mesh. If I untick “Batching Static” the lightmapindex is still reset, but when I set it again at runtime its then correct. But its still getting reset when I build or click play, and I’d obviously like to batch it as well.
So it seems there’s something not set somewhere, any ideas!? :slight_smile: