Add Cull to LOD Group via editor script

Hello,

I’m having some troubles with the LOD Grouping API from Unity. I’ve made an editor tool to add a LOD group to my object & I have the two levels I wanted, but when you assign the LODs via LODGroup.SetLODs() it removes the CULL level & so far I cannot see how to re-add it, tried some hacky ways to get it on but nothing…Am I blind or something? :S

Does anyone have a solution?

Much appreciated!

How are you setting them? I can’t seem to duplicate what you’re describing.

private void Start()
{
   LODGroup group = GetComponent<LODGroup>();
   LOD[] lods = new LOD[2];
   lods[0] = new LOD(0.50f, null);
   lods[1] = new LOD(0.25f, null);

   group.SetLODs(lods);
   group.RecalculateBounds();
}

6893450--806333--capture.jpg

2 Likes

Ok, so I found the prob & fixed it thanks for helping! I tried the NULL before but had some error and now I just realised that the first LOD level is always there and the ones in the array are extra…

1 Like