GameObject.Find returning null, though requested go exists

I have an empty go called “n14_SplineController” in my scene. Yet when using GameObject.Find from a script on another object, it returns null.
As you can see, I have a debug.log in place, which confirms its null. Then all errors break loose as I try to use the var SplineParent in my code.

Context: I’m using the Hermite Spline Controller (from the Unify community site) to have a point light move along a path once its instantiated from Resources. The script posted is attached to the point light prefab. I can’t define the var SplineParent by dragging into the Inspector, because once its in Resources it won’t let me. I also tried tagging the “n14_SplineController” and finding by tag as well as putting the code in Awake instead of Start, all to no avail.

var SplineParent : GameObject;

function Start()
{
	SplineParent = GameObject.Find("n14_SplineController");
	Debug.Log(SplineParent);
	SplineParent.SetActive(true);
		
	mSplineInterp = gameObject.AddComponent(SplineInterpolator);
	
	mTransforms = GetTransforms();
	
	if (HideOnExecute)
		DisableTransforms();
	
	if (AutoStart)
		FollowSpline();
}

…the script continues from there.

SplineParent = GameObject.Find(“n14_SplineController”);
Debug.Log(SplineParent);
SplineParent.SetActive(true);

it looks like you are suing this to activate your object but Find does not find inactive objects, it has been complained about for years but has not changed ever since.

You should get the reference while the object is still active and use that instead of looking for it.

If you need your object to be inactive and the script looking for it is on another object that is created later on (so you cannot already pass the reference), then make it a child of an object you keep active then look for that parent object and use:

  Component [] comps = parentObject.GetComponentsInChildren(typeof(Transform), true);
  foreach(Component c in comps){
        if(c.name == "n14_SplineController"){
             c.gameObject.SetActive(true);
        }
  }