diff --git a/NewHorizons/Utility/SearchUtilities.cs b/NewHorizons/Utility/SearchUtilities.cs index cd728301..5efb90f8 100644 --- a/NewHorizons/Utility/SearchUtilities.cs +++ b/NewHorizons/Utility/SearchUtilities.cs @@ -90,7 +90,7 @@ namespace NewHorizons.Utility /// /// finds active or inactive object by path, - /// or recursively finds an active object by name + /// or recursively finds an active or inactive object by name /// public static GameObject Find(string path, bool warn = true) { @@ -113,8 +113,11 @@ namespace NewHorizons.Utility go = root.FindChild(childPath); if (go == null) { - if (warn) Logger.LogWarning($"Couldn't find child object in path ({path})"); - return null; + var name = names.Last(); + if (warn) Logger.LogWarning($"Couldn't find object in path ({path}), will look for potential matches for name {name}"); + // find resource to include inactive objects + // also includes prefabs but hopefully thats okay + go = FindResourceOfTypeAndName(name); } }