Jump to content

GUI.Control isVisible does not work if linked with a mesh


Recommended Posts

10 hours ago, Samuel Girardin said:

In advancedDynamicTexture.ts or  the whole  js file

Around line 205. You can add. Maybe I'm wrong. It seems to fix the pb.

 if (projectedPosition.z < 0 || projectedPosition.z > 1 ) {
     control.isVisible = false;

// add this above the first if
 if (!control.isVisible) {                        


Thanks Samuel,

looking into your example: https://www.babylonjs-playground.com/#ZI9AK7#21 I've figured out that the hiding in your case works due to the way how you instantiate the texture:

advancedTexture = BABYLON.GUI.AdvancedDynamicTexture.CreateForMesh(plane);

while I do:

advancedTexture = BABYLON.GUI.AdvancedDynamicTexture.CreateFullscreenUI("ui1");

As I'm really not proficient with 3D programming, I do not understand the difference - will read the documentation one of these days. 

I would prefer not to change the js library - it goes far beyond my knowledge - until 2 weeks ago I've never programmed java script ... For me would be simpler not to use CreateFullscreenUI for the time being and wait till the fix becomes a part of the release.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...