- Home /
Find the LOD step which is currently used
This is more of an answer than a question. However if you have a better solution, dont hesitate to post it :)
So I tried to figure out which LOD step was currently used in a LOD group while in play mode. After looking at the very unsatisfactory LODGroup-class I figured out another approach:
LODGroup lodGroup = obj.GetComponent<LODGroup>();
if (lodGroup != null)
{
Transform lodTransform = lodGroup.transform;
foreach (Transform child in lodTransform)
{
if (child.renderer != null && child.renderer.isVisible)
{ Debug.Log("This LODstep is used: " + child.name); }
}
}
Seems to be working just fine :)
Comment
Thanks for this, I wish I had enough reputation to upvote you.
Your answer
Follow this Question
Related Questions
[unity_LODFade] value is different between LWRP and legacy 0 Answers
Mesh based Particle System LOD? 0 Answers
My LOD is not working the way I wanted it to. 0 Answers
LOD from one file? 1 Answer
Are LODGroup and LOD not fully supported in 3.5.x? 0 Answers