Hi! my question is simple
i want to check if an object in the scene exist, i know how to do that, but, from that, if the object is not found, i want to set a variable to false, but unity of course will trow a null reference exception and my code wont run, is there a way to tell if an object is not present wihtout unity trowing exceptions? this is for editor window scripting btw.
here is the code i have until now
private void CheckIfPrefabHierarchyExist()
{
Transform holder = GameObject.Find("Bacterias").transform;
if (holder == null)
{
hierarchyPrefabDetected = false;
}
else
{
hierarchyPrefabDetected = true;
}
}