# Error when using AdvancedDynamicTexture

**URL:** <https://forum.babylonjs.com/t/error-when-using-advanceddynamictexture/16614>\
**Category:** Bugs\
**Created:** [December 14, 2020, 9:52am UTC](https://forum.babylonjs.com/t/error-when-using-advanceddynamictexture/16614 "2020-12-14T09:52:04Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![javismiles](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/javismiles/32/12924_2.png) [@javismiles](https://forum.babylonjs.com/u/javismiles)\
**Post date:** [December 14, 2020, 9:52am UTC](https://forum.babylonjs.com/t/error-when-using-advanceddynamictexture/16614/1 "2020-12-14T09:52:04Z")

</div>

I have a model loaded in babylon successfully, with a texture applied

I want to add floating labels in the 3d space,  
so I try to use

var advancedTexture = GUI.AdvancedDynamicTexture.CreateFullscreenUI(“UI”);

but every time I use that line, I get errors  
either getcomponent null error or onsuccess callback error from append mesh  
babylon.js:16 Uncaught TypeError: Cannot read property ‘\_getComponent’ of null

what is the best way to add floating labels in 3d space without errors?  
thank you very much

---

<div class="post-metadata">

**Author:** ![javismiles](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/javismiles/32/12924_2.png) [@javismiles](https://forum.babylonjs.com/u/javismiles)\
**Post date:** [December 14, 2020, 9:57am UTC](https://forum.babylonjs.com/t/error-when-using-advanceddynamictexture/16614/2 "2020-12-14T09:57:30Z")

</div>

this is somebody elses example but they get similar error

> **[Babylon.js Playground](https://playground.babylonjs.com/#YWDWH9)**

---

<div class="post-metadata">

**Author:** ![Dad72](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/dad72/32/13_2.png) [@Dad72](https://forum.babylonjs.com/u/Dad72)\
**Post date:** [December 14, 2020, 11:23am UTC](https://forum.babylonjs.com/t/error-when-using-advanceddynamictexture/16614/3 "2020-12-14T11:23:31Z")

</div>

It works if a scene is created :

> **[Babylon.js Playground](https://playground.babylonjs.com/#YWDWH9%231)**

---

<div class="post-metadata">

**Author:** ![javismiles](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/javismiles/32/12924_2.png) [@javismiles](https://forum.babylonjs.com/u/javismiles)\
**Post date:** [December 14, 2020, 11:37am UTC](https://forum.babylonjs.com/t/error-when-using-advanceddynamictexture/16614/4 "2020-12-14T11:37:36Z")

</div>

thank you,  
I already had a scene, in any case if I try to create a scene, it says -engine- doesn’t exist,  
where is engine coming from?

---

<div class="post-metadata">

**Author:** ![javismiles](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/javismiles/32/12924_2.png) [@javismiles](https://forum.babylonjs.com/u/javismiles)\
**Post date:** [December 14, 2020, 11:39am UTC](https://forum.babylonjs.com/t/error-when-using-advanceddynamictexture/16614/5 "2020-12-14T11:39:11Z")

</div>

yes I already had scene and engine:

const scene = new Scene(engine, sceneOptions);

```
  if (scene.isReady()) {

    props.onSceneReady(scene);

  } else {

    scene.onReadyObservable.addOnce((scene) => props.onSceneReady(scene));

  }
```

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [December 14, 2020, 11:46am UTC](https://forum.babylonjs.com/t/error-when-using-advanceddynamictexture/16614/6 "2020-12-14T11:46:52Z")

</div>

The engine is automatically created for you in the playground. If you don’t use the playground, you will need to create it yourself and pass it to the scene constructor.

One thing you can test is to pass the scene to the `CreateFullscreenUI` method as the 3rd parameter.

But a repro would be the way to go as it is working in the example playground provided by @Dad72.

---

<div class="post-metadata">

**Author:** ![javismiles](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/javismiles/32/12924_2.png) [@javismiles](https://forum.babylonjs.com/u/javismiles)\
**Post date:** [December 14, 2020, 11:54am UTC](https://forum.babylonjs.com/t/error-when-using-advanceddynamictexture/16614/7 "2020-12-14T11:54:56Z")

</div>

just checked, I have scene and engine all created,  
problem is that im doing react app, and I have two separate files so not sure how to include that in the playground

---

<div class="post-metadata">

**Author:** ![javismiles](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/javismiles/32/12924_2.png) [@javismiles](https://forum.babylonjs.com/u/javismiles)\
**Post date:** [December 14, 2020, 12:00pm UTC](https://forum.babylonjs.com/t/error-when-using-advanceddynamictexture/16614/8 "2020-12-14T12:00:53Z")

</div>

const onSceneReady = (scene) =\> {

console.log(scene);

var advancedTexture = GUI.AdvancedDynamicTexture.CreateFullscreenUI(

```
"UI",

1000,

1000,

scene

```

);

I am receiving the created scene in that event handler, and I do console log and its there.  
And yet same error

in any case what i want to do is to create floating text labels in the 3d space,  
I try 1000 things but I cannot make it

look just put the code here

> **[Babylon.js Playground](https://playground.babylonjs.com/#GESJB4%233)**

it says GUI not found, how can I include GUI library?

and in any case how can I make floating text label positioned in 3d space without panel or button?

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [December 14, 2020, 12:07pm UTC](https://forum.babylonjs.com/t/error-when-using-advanceddynamictexture/16614/9 "2020-12-14T12:07:19Z")

</div>

It’s BABYLON.GUI, not simply GUI (same thing for Vector3).

Look at the [API doc for CreateFullscreenUI](https://doc.babylonjs.com/typedoc/classes/babylon.gui.advanceddynamictexture#createfullscreenui), you don’t pass it sizes and the scene is the 3rd parameter, not the 4th.

See your other threads for creating floating text labels ([Text is not rendered, issues creating floating labels in 3d space](https://forum.babylonjs.com/t/text-is-not-rendered-issues-creating-floating-labels-in-3d-space/16616)).

---

<div class="post-metadata">

**Author:** ![javismiles](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/javismiles/32/12924_2.png) [@javismiles](https://forum.babylonjs.com/u/javismiles)\
**Post date:** [December 14, 2020, 12:14pm UTC](https://forum.babylonjs.com/t/error-when-using-advanceddynamictexture/16614/10 "2020-12-14T12:14:28Z")

</div>

yes now it works

> **[Babylon.js Playground](https://playground.babylonjs.com/#W64GZY%2331)**

  
now i have to get rid of panel and button to have just label 🙂
