Simple instantiate a variable

I made a map editor script and im making it duplicate for some reason I cant get the instantiate to work correctly. Any way hears the duplicating part.

    public Transform Editing;

void OnGUI()
{ 
    if(GUI.Button(new Rect(400, 0, 50, 50), "Dup"))
    		{
    			Instantiate(Editing, transform.position, transform.rotation) as Transform;
    		}
}

You are instantiating a transform, which is only a component. You have to do it to the gameobject in order to copy everything.

Here’s your code:

public Transform Editing;

void OnGUI()
{ 
  if(GUI.Button(new Rect(400, 0, 50, 50), "Dup"))
  {
    Instantiate(Editing.gameObject, transform.position, transform.rotation);
  }
}