GameObject.find and positioning

Hello,
I am instantiating objects at run-time and i’m naming them i+“empty” , where i is the variable for the cycle that is instantiating the objects, and when I try to find those objects in another cycle and set them active like this:

for (int i = 0; i<cardList.Count; i++) {
      GameObject emp;
      emp = GameObject.Find(i+"empty") as GameObject;
      emp.SetActive(true);
  }

When I run the project I get a “Object reference not set to an instance of an object.” error, what am I doing wrong?

Another question, take the same object as above, how can I position hit so it gets the same position across the various sizes of monitors/resolutions ? I’m actually positioning the objects with their pixel inset components but I want to position them with the transform component.

Thanks in advance

GameObject.Find only finds active GameObjects, unfortunately.

Remember, though, that Instantiate returns a reference to the newly created object:

//assumes "empPrefab" is set elsewhere
GameObject emp = Instantiate(empPrefab) as GameObject;

You could keep that reference, perhaps in an array, list, dictionary, or some other collection. See the Unity wiki article Which Kind Of Array Or Collection Should I Use?