MultiCamera and linkWithMesh create duplicate GUI control

When I use linkWithMesh with multiple cameras, the GUI control is duplicated. One is attached to the mesh and the other is not.

If I remove the linkWithMesh from the control, it works correctly, I only have one GUIConrol display.

  1. You can see the bug on this PG : one button of which is attached to the sphere and another button which appears as the sphere moves. (Another button should not appear.)
  2. Then the attach to mesh button can’t be clicked, and the other one that shouldn’t appear can be clicked. It’s the normally attach to mesh button that should be clickable, not the Duplicate button that shouldn’t exist.

If you disable the link with the mesh, everything is OK.

Interesting. I’ve been trying a couple of things but I believe you DO NOT WANT the button to show in the minimap, do you? It’s all around the layerMasks and attaching cameras. By linking the advancedTexture to the mesh, you actually take that layerMask and I have been unable to dissociate it. So either I can click the button but have no minimap showing (because I would need to add another layerMask to all background scenes meshes) or I have the minimap but I have a duplicate of the button showing in the minimap.
May be @Evgeni_Popov (he might be on vacation, in case, sry to disturb :grin: :beach_umbrella:, may be he knows… he probably does… he knows everything about this kind of stuff… and I still don’t, obviously :cry:

I tried several things and came to the same conclusion as you.
Yes, I don’t want to show the GUI in the minimap.
Maybe it would take in the parameters of linkWithMesh() an additional option to choose the layerMask as linkWithMesh(mesh, scene, layerMaskUse) ?

I’m not sure what the cameraGUI is used for?

I think you want the GUI to be displayed for the cameraPlayer, so something like this should do it:

The cameraGUI is for displaying only the graphical interface without the post-process impacting the GUI.

If I do this and use blur post-processes, my GUI is also blurry. So I created a camera for the GUI.

Also with your solution it can be seen that the GUI button cannot be clicked
If not, is there a way for the graphical interface not to be impacted by post-processes, which would allow me to get rid of the cameraGUI.

Ok, in that case you should make the GUI render for the cameraGUI camera only, not for both cameraPlayer and cameraGUI (meaning, don’t set a layerMask for cameraPlayer).

And for the GUI element to be displayed at the right location, the cameraGUI should be the same than the cameraPlayer (same position, rotation, etc). The easiest way to do that is to create it with the same parameters than cameraPlayer (ie. make a clone) and to attach it to the canvas so that it moves in the same way than cameraPlayer:

3 Likes

It seems to work like that. Thanks @Evgeni_Popov.

Instead of cloning I made the cameraGUI child of the cameraPLayer. Because the cameraPLayer follows a character/avatar and is an arcRotateCamera. So the cameraGUI which is a freeCamera is attached to the cameraPLayer which is an arcRotateCamera.

It seems to work fine like that. Thank you

I just knew it would be something (simple) like that. I was (very) close to it but still not there yet :disappointed_relieved:. Thanks for sorting this out (once again) :smiley: