Sorry to ask something again but I really didn’t found anything about it outside the forum.
I add a number at instantiate of an object. Simple script attached to the object:
void Awake () {
name +=ID.ToString();
++ID;
}
After instantiate the object you see in hierachy
Object(Clone)0
Object(Clone)1
Object(Clone)2
Now I need to search this object to save position. I tried:
static GameObject search;
search = GameObject.Find("Object" + ID);
I also tried:
static GameObject search;
search = GameObject.Find("Object(Clone)" + ID);
My Debug says Null, so I think it don’t work.
Anybody has an Idea what’s wrong?
ID will be +1 larger once you use it like that to do a search. So there won’t be an object with that ID yet in the scene.
Eric5h5
3
Your second method is correct. I would assume you’re trying to use an ID that doesn’t exist on any gameobjects.
–Eric
Raz, so you mean instantiating Object(Clone)5, my script will search for 6? Right6?
That’s what it looks like to me, yeah.
Before I play around toomuch with it. Will Debug display the complete name right when code is ok? I know sometimes Debug don’t wanna do it’s work… 
Simple lol: search = GameObject.Find(name);
Because after instantiate the value name got override. Nice, nice…
I was afraid Debug will not work properly more than being afraid not to find a solution… ty!