I have a strange one … In the following playground (check the console output) I have a sphere in the main scene and a box in the utility layer scene and am observing onPointerObservable
on each to determine if the pointer is over the main scene sphere or the utility layer box. I set the canvas.style.cursor = "pointer"
when it is over either mesh.
The main scene sphere works as expected.
Now for the utility layer box, with utilityLayer.onlyCheckPointerDownEvents = true;
then the console output is correct i.e. it correctly shows pointer over or not over box, however the cursor change doesn’t happen despite the setPointer()
function is definitely called.
But, if I set utilityLayer.onlyCheckPointerDownEvents = false;
the cursor change works correctly but the console output is incorrect (isOverBox
never reverts to false
).
Also the utilityLayer.onPointerOutObservable
never seems to fire under any circumstances, despite documentation stating “Observable raised when the pointer moves from the utility layer scene to the main scene”.
How do I get the pointer change and isOver
variables to update consistently across both the main scene and the utility layer?