This control has already been added to a Spatial?

I’m creating a new control and adding it to a geometry like so.

  String name = "button" + controlTotal;
  Button button = new Button(name,font,gameManager,this,settings);
  button.setSize(new Size(500,500));
  button.setLocation(new Location(450,450));

  Geometry geometry = new Geometry(name, new Quad(1,1));
  Material material = new Material(app.getAssetManager(), "Common/MatDefs/Misc/Unshaded.j3md");
  material.getAdditionalRenderState().setBlendMode(RenderState.BlendMode.Alpha); 
  geometry.setMaterial(material);
  geometry.addControl(control);
  node.attachChild(geometry);

Everytime I run this it tells me the control has already been added. I have no clue what is happening here. Can someone help me out? Thanks.

I don’t see you create a new control in that code…? Or is it the one named “button”? But then you add something named “control”.

Button is the control and I figured it out. I was initializing the controls spatial in the constructor and making it into a geometry. Apparently once the spatial is created it is automatically attached to the control.