code: (click on corner right for look code)
https://codepen.io/joffrey-courty/pen/xxJvgVL
Hi,
Hope you are well.
I believe this is partly my bad and you nearly fixed it by changing the order of attaching the cameras.
A second part comes from the layerMasks (order).
Finally, to avoid any potential later issue if you keep adding controls on top of the scene comes from that some GUI controls act as a āpointerBlockerā (typically the textBlock). These controls by default block all interactions with scene meshes no matter if they are in front or behind the GUI (visually or in the hierarchy).
So, the fix is ez and comes in two parts:
- On line 1374, Change the order for activeCameras to:
scene.activeCameras = [minicamera, cameramain, cameraGUI];
- On line 1138, Set the layerMask of the advancedDynamicTexture and the ācameraGUIā to
cameraGUI.layerMask = 0xFFFFFFF0;
2a) On line 1144, Set the main (scene) camera layerMask to:
cameramain.layerMask = 0x10000000;
- (optional). To make sure none of your controls act as a pointerBlocker, you can either set them manually on the control
control.isPointerBlocker = false;
or for all of 'em you could do something like:
advancedTexture.getDescendants().forEach(function(control) {
control.isPointerBlocker = false;
});
Hope this helps and sry for the confusion if I did simply answer your previous without anticipating this next coming issue (which I should have because it was obvious)
Meanwhile, have a great weekend
perfect! :DDD
ā¦
u are a boss!
just explain me why : ā0x10000000ā or ā0xFFFFFFF0ā, and not 0 1 2 ? iām curious
Itās basically because of the way layers are used for rendering in BJS. The result of the AND operation determines if a layer is visible or not (a mesh by the camera but also other processes, such as particles or post and of course, the GUI layer). You can actually use 0,1,2,3 (which will fill the empty 4 bits left in the default value as to ease the operation) and then you can actually use any value up to 4294967295 as an input value. BUT it is the result of the AND operation that will flag if the layer is visible or not. Therefor, itās easier to use hexadecimal.
In most cases, itās enough to do that. But knowing of the correct input value, Iād say itās better to use straight a hexadecimal value.
As for the detailed explanation, you can find it here.
Meanwhile, have a great day