Transform child = GameObject.FindWithTag("state").transform;
child.name = first_guy+""; child.tag = first_guy+"";
GameObject child_dup = Instantiate( child, new Vector3(0,0,0),Quaternion.identity) as GameObject;
Debug.Log (child_dup.name);
The above code gives me error, "NullReferenceException: Object reference not set to an instance of an object". Is this because I am trying to instantiate a local variable? How to duplicate a gameobject in run time?