BABYLON.ActionManager for mesh in utilityLayerScene not working.
PG: Babylon.js Playground
(Related to question Actions on meshes in utility layer are not triggered)
BABYLON.ActionManager for mesh in utilityLayerScene not working.
PG: Babylon.js Playground
(Related to question Actions on meshes in utility layer are not triggered)
@PolygonalSun would you be able to take a look?
I can take a look and see what’s going on.
So here’s what I’ve found. By default, we detach the InputManager controls from the utilityLayerScene to manually handle picking. Because of this, any pointerover/out code that we have isn’t running so that’s why those specific triggers aren’t working. I’m still trying to figure out the best approach but I do have a workaround. You should be able to just attach controls to the utilityLayerScene:
let l = new BABYLON.UtilityLayerRenderer(scene, true);
l.utilityLayerScene.attachControl();
I’m not sure if this will work for your current scenario in the meantime but lemme know how this works for you.
The attachControl() call makes things work BUT then “onhover highlight” of regular gizmos stop working.
@Cedric do you mind having a look?
I do not think this is something we support but I want to be sure.
Let me take a look.
Any luck?
I’m been very busy lately but it’s still on my radar. I’ll keep you posted.
Sorry again for the delay.
I did a quick test and was able to get gizmo with onhover :
Spotlight Not Blocked By Mesh | Babylon.js Playground (babylonjs.com)
Thanks for looking into this.
I went back to my code and step by step tried to update your PG to reproduce the error and finally I found it: I send in “l”, the UtilityRenderer, to the constructor of BABYLON.AxisDragGizmo and that causes the hover effect to stop functioning. I have created a new PG showing this - https://playground.babylonjs.com/#3JBK76#3
Not sure if anything else will break if I don’t send the UtilityRenderer.
Thanks again,
—bjorn