diff --git a/Assets/UniGLTF/Runtime/UniGLTF/RuntimeGltfInstance.cs b/Assets/UniGLTF/Runtime/UniGLTF/RuntimeGltfInstance.cs index f92788385..62eef99ba 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/RuntimeGltfInstance.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/RuntimeGltfInstance.cs @@ -104,7 +104,7 @@ namespace UniGLTF public void ShowMeshes() { - foreach (var r in GetComponentsInChildren()) + foreach (var r in Renderers) { r.enabled = true; } @@ -112,9 +112,9 @@ namespace UniGLTF public void EnableUpdateWhenOffscreen() { - foreach (var smr in GetComponentsInChildren()) + foreach (var skinnedMeshRenderer in SkinnedMeshRenderers) { - smr.updateWhenOffscreen = true; + skinnedMeshRenderer.updateWhenOffscreen = true; } }