ActionManager on gizmo

Hi everyone !
I have two problems :

1 - I have custom gizmo axes, but I can not add actions (hover, click) on them. Here is a playground.

2 - I would also like to see on the ground an ellipse of the size of the sphere, which moves at the same time as the sphere in the plane of the ground. I think it’s related to actions and GUI, but I do not see how.

Can someone help me, please ?

Pinging our gizmo overlord: @trevordev

  1. the utility layers utilityLayerScene needs to be used and Im not sure if action manager supports utility layers. Would pointer observable work for you? Here the playground with it working: https://www.babylonjs-playground.com/#31M2AP#52

  2. I may misunderstand you but could you use scene.onBeforeRenderObservale to cast a ray from the spheres position straight down using scene.pickWithRay and move an ellipse to the point it hits the ground?

1 Like

Thank you :wink:

  1. Pointer observable is ok for me, but I would like to access the other two axes (to hide the time of drag). And also, I would like that the color (white) is maintained the time of the drag (even if the pointer is not on the axis).

  2. In my app, a user clicks a button to add one or more spheres that he can then move above the ground. I would like an ellipse to represent the final position of each sphere on the ground, if the user clicks a “set gravity” button. (The ellipse can be a simple cross or a dot, indicating the center of the sphere.)

Sorry for my english.

  1. in the onPointerObservable you can check e.type == BABYLON.PointerEventTypes.POINTERDOWN and use that to hide the other axis, you may want to have only one onPointerObservable and handle the logic for all 3 axis inside it.

  2. I’m still not sure I understand, maybe a playground attempt or a picture would help. My answer above still seems like it should work if i understand correctly.

1 Like

Thank you @trevordev !
I play with Ray as you suggest in your first post and it works pretty well. I had misunderstood the point of “cast a ray”.
Thanks again.

1 Like