Attach Gizmo to a custom UtilityLayerRenderer

I’m trying to attach a gizmo to a custom UtilityLayerRenderer.
The problem seems that the custom utilityLayerScene does not receive mouse events.

Here my test:

https://www.babylonjs-playground.com/#DYP0ML

Am I doing something of wrong or Is it a bug ?

TIA

pinging @trevordev

Could you elaborate on your use case?

In this playground (https://www.babylonjs-playground.com/#31M2AP#47) it is creating a custom utility layer renderer, adding a gizmo in it, then the gizmo is attached to an object in the main scene, pointer events work. Or are you trying to do something different?

Sorry I was not clear. I’m trying to attach a gizmo on a mesh created on specific UtilityLayerRenderer.
The example you gave me , the meshes are on the main scene.

I hope I made my self clear

Yea, I tried https://www.babylonjs-playground.com/#31M2AP#48 and see that there is an issue as there is no way to specify the priority of the rendering or picking. I will add a method to reorder observables makeTopPriority and makeBottomPriority and expose these on the utility layer.

@DrEight after this PR is done ability to set observer priority, utility layer pointer priority shou… by TrevorDev · Pull Request #5954 · BabylonJS/Babylon.js · GitHub this playground should work as expected Babylon.js Playground. Let me know if you still have issues.

I tried, but my example does not work as expected. What do I have to do ?

In that playground there is a custom utility layer which the sphere mesh is added to. Then the gizmo is added to another utility layer on top of that one. The gizmo works as expected. Scene pointer event on the meshes gizmo layer supports picking. Is there something that you would like to work differently?

Sorry I lost the notification of this thread. Yes, it is working as expected. Thank you!

1 Like