I’m “refreshing” an LOD group component at runtime using the following code:
LODGroup lodGroup = GetComponent<LODGroup>();
if( lodGroup != null ) {
List<Renderer> renderers = new List<Renderer>( GetComponentsInChildren<Renderer>() );
LOD[] lods = new LOD[3];
lods[0] = new LOD(1f, new Renderer[0]);
lods[1] = new LOD(0.25f, renderers.FindAll((obj)=>{return obj.name.Contains("LOD0");}).ToArray());
lods[2] = new LOD(0.01f, renderers.FindAll((obj)=>{return obj.name.Contains("LOD1");}).ToArray());
lodGroup.SetLODS( lods );
lodGroup.RecalculateBounds();
}
Unfortunately, I may be confused about the format of the SetLODS argument, since this code creates LOD1, LOD2, and Culled, with no LOD0. This results in my character disappearing when the camera gets too close to him. Is there any way to access/edit LOD0?