Clone element GUI : this._host.getScene is not a function

Hello,

In the doc it is said that one can clone an element guy but that does not seem to work.

const cloned = control.clone();
adt.addControl(cloned);

And by the way in this doc who says: an example can be seen here
If I click to open the example PG. There is nothing that clones an element. :
https://doc.babylonjs.com/features/featuresDeepDive/gui/gui/#cloning

By cons the example that clones an ADT is OK, it works. It is only cloning elements/control

1 Like

There was some error in the PG. See Button.clone API - Babylon.js docs

clone(host?: AdvancedDynamicTexture): Control

Example - https://playground.babylonjs.com/#XCPP9Y#22844

I think it could be possible to use this example in the Documentation?

Thank you @Labris. I had not understood that Clone received the ADT. I thought it was the name as for meshes

1 Like