# ActionManager on gizmo

**URL:** <https://forum.babylonjs.com/t/actionmanager-on-gizmo/2060>\
**Category:** Questions\
**Created:** [March 22, 2019, 10:28am UTC](https://forum.babylonjs.com/t/actionmanager-on-gizmo/2060 "2019-03-22T10:28:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sven](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sven/32/1323_2.png) [@Sven](https://forum.babylonjs.com/u/Sven)\
**Post date:** [March 22, 2019, 10:28am UTC](https://forum.babylonjs.com/t/actionmanager-on-gizmo/2060/1 "2019-03-22T10:28:30Z")

</div>

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](https://www.babylonjs-playground.com/#31M2AP#51).

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 ?

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [March 22, 2019, 3:52pm UTC](https://forum.babylonjs.com/t/actionmanager-on-gizmo/2060/2 "2019-03-22T15:52:16Z")

</div>

Pinging our gizmo overlord: @trevordev

---

<div class="post-metadata">

**Author:** ![trevordev](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/trevordev/32/16_2.png) [@trevordev](https://forum.babylonjs.com/u/trevordev)\
**Post date:** [March 22, 2019, 6:19pm UTC](https://forum.babylonjs.com/t/actionmanager-on-gizmo/2060/3 "2019-03-22T18:19:40Z")

</div>

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](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?

---

<div class="post-metadata">

**Author:** ![Sven](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sven/32/1323_2.png) [@Sven](https://forum.babylonjs.com/u/Sven)\
**Post date:** [March 22, 2019, 8:22pm UTC](https://forum.babylonjs.com/t/actionmanager-on-gizmo/2060/4 "2019-03-22T20:22:24Z")

</div>

Thank you 😉

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.

---

<div class="post-metadata">

**Author:** ![trevordev](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/trevordev/32/16_2.png) [@trevordev](https://forum.babylonjs.com/u/trevordev)\
**Post date:** [March 22, 2019, 9:03pm UTC](https://forum.babylonjs.com/t/actionmanager-on-gizmo/2060/5 "2019-03-22T21:03:46Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Sven](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sven/32/1323_2.png) [@Sven](https://forum.babylonjs.com/u/Sven)\
**Post date:** [March 23, 2019, 2:22pm UTC](https://forum.babylonjs.com/t/actionmanager-on-gizmo/2060/6 "2019-03-23T14:22:38Z")

</div>

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.
