Hello,
How can I attach an instantiated prefab to an object on the scene ?
I use this code, but the method AddComponent doesn’t work :
GameObject child;
child = (GameObject)Instantiate(prefabModels[objectIndex], transform.position, transform.rotation);
child.name = "child";
GameObject container = GameObject.Find("container");
container.AddComponent("child") as GameObject; //doesn't work