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