diff --git a/NewHorizons/Utility/SearchUtilities.cs b/NewHorizons/Utility/SearchUtilities.cs index 6f4d1be5..7ecee7fe 100644 --- a/NewHorizons/Utility/SearchUtilities.cs +++ b/NewHorizons/Utility/SearchUtilities.cs @@ -119,9 +119,9 @@ namespace NewHorizons.Utility var name = names.Last(); if (warn) Logger.LogWarning($"Couldn't find object in path {path}, will look for potential matches for name {name}"); - // 3: find resource to include inactive objects - // also includes prefabs but hopefully thats okay - go = FindResourceOfTypeAndName(name); + // 3: find resource to include inactive objects (but skip prefabs + go = Resources.FindObjectsOfTypeAll() + .FirstOrDefault(x => x.scene.name != null && x.name == name); if (go) { CachedGameObjects.Add(path, go);