# BABYLON.ActionManager for mesh in utilityLayerScene not working

**URL:** <https://forum.babylonjs.com/t/babylon-actionmanager-for-mesh-in-utilitylayerscene-not-working/27825>\
**Category:** Bugs\
**Created:** [February 20, 2022, 2:07pm UTC](https://forum.babylonjs.com/t/babylon-actionmanager-for-mesh-in-utilitylayerscene-not-working/27825 "2022-02-20T14:07:58Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![bjornbacklund](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bjornbacklund/32/14097_2.png) [@bjornbacklund](https://forum.babylonjs.com/u/bjornbacklund)\
**Post date:** [February 20, 2022, 2:07pm UTC](https://forum.babylonjs.com/t/babylon-actionmanager-for-mesh-in-utilitylayerscene-not-working/27825/1 "2022-02-20T14:07:58Z")

</div>

BABYLON.ActionManager for mesh in utilityLayerScene not working.  
PG: [Babylon.js Playground](https://playground.babylonjs.com/#3JBK76)

(Related to question [Actions on meshes in utility layer are not triggered](https://forum.babylonjs.com/t/actions-on-meshes-in-utility-layer-are-not-triggered/8325))

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [February 21, 2022, 1:27pm UTC](https://forum.babylonjs.com/t/babylon-actionmanager-for-mesh-in-utilitylayerscene-not-working/27825/2 "2022-02-21T13:27:06Z")

</div>

@PolygonalSun would you be able to take a look?

---

<div class="post-metadata">

**Author:** ![PolygonalSun](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/polygonalsun/32/2704_2.png) [@PolygonalSun](https://forum.babylonjs.com/u/PolygonalSun)\
**Post date:** [February 22, 2022, 3:02pm UTC](https://forum.babylonjs.com/t/babylon-actionmanager-for-mesh-in-utilitylayerscene-not-working/27825/3 "2022-02-22T15:02:34Z")

</div>

I can take a look and see what’s going on.

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [February 22, 2022, 3:06pm UTC](https://forum.babylonjs.com/t/babylon-actionmanager-for-mesh-in-utilitylayerscene-not-working/27825/4 "2022-02-22T15:06:54Z")

</div>

Assigned @PolygonalSun on February 22, 2022, 3:06pm UTC



---

<div class="post-metadata">

**Author:** ![PolygonalSun](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/polygonalsun/32/2704_2.png) [@PolygonalSun](https://forum.babylonjs.com/u/PolygonalSun)\
**Post date:** [February 23, 2022, 5:10pm UTC](https://forum.babylonjs.com/t/babylon-actionmanager-for-mesh-in-utilitylayerscene-not-working/27825/5 "2022-02-23T17:10:36Z")

</div>

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:

```auto
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.

---

<div class="post-metadata">

**Author:** ![bjornbacklund](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bjornbacklund/32/14097_2.png) [@bjornbacklund](https://forum.babylonjs.com/u/bjornbacklund)\
**Post date:** [February 24, 2022, 8:55am UTC](https://forum.babylonjs.com/t/babylon-actionmanager-for-mesh-in-utilitylayerscene-not-working/27825/6 "2022-02-24T08:55:50Z")

</div>

The attachControl() call makes things work BUT then “onhover highlight” of regular gizmos stop working.

---

<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 18, 2022, 5:46pm UTC](https://forum.babylonjs.com/t/babylon-actionmanager-for-mesh-in-utilitylayerscene-not-working/27825/7 "2022-03-18T17:46:16Z")

</div>

@Cedric do you mind having a look?

I do not think this is something we support but I want to be sure.

---

<div class="post-metadata">

**Author:** ![Cedric](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/cedric/32/2742_2.png) [@Cedric](https://forum.babylonjs.com/u/Cedric)\
**Post date:** [March 18, 2022, 5:51pm UTC](https://forum.babylonjs.com/t/babylon-actionmanager-for-mesh-in-utilitylayerscene-not-working/27825/8 "2022-03-18T17:51:06Z")

</div>

Let me take a look.

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [March 18, 2022, 11:05pm UTC](https://forum.babylonjs.com/t/babylon-actionmanager-for-mesh-in-utilitylayerscene-not-working/27825/9 "2022-03-18T23:05:25Z")

</div>

Unassigned @PolygonalSun on March 18, 2022, 11:05pm UTC



---

<div class="post-metadata">

**Author:** ![bjornbacklund](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bjornbacklund/32/14097_2.png) [@bjornbacklund](https://forum.babylonjs.com/u/bjornbacklund)\
**Post date:** [March 30, 2022, 9:44am UTC](https://forum.babylonjs.com/t/babylon-actionmanager-for-mesh-in-utilitylayerscene-not-working/27825/10 "2022-03-30T09:44:32Z")

</div>

Any luck?

---

<div class="post-metadata">

**Author:** ![Cedric](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/cedric/32/2742_2.png) [@Cedric](https://forum.babylonjs.com/u/Cedric)\
**Post date:** [March 30, 2022, 9:45am UTC](https://forum.babylonjs.com/t/babylon-actionmanager-for-mesh-in-utilitylayerscene-not-working/27825/11 "2022-03-30T09:45:33Z")

</div>

I’m been very busy lately but it’s still on my radar. I’ll keep you posted.

---

<div class="post-metadata">

**Author:** ![Cedric](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/cedric/32/2742_2.png) [@Cedric](https://forum.babylonjs.com/u/Cedric)\
**Post date:** [April 5, 2022, 12:01pm UTC](https://forum.babylonjs.com/t/babylon-actionmanager-for-mesh-in-utilitylayerscene-not-working/27825/12 "2022-04-05T12:01:14Z")

</div>

@bjornbacklund

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)](https://playground.babylonjs.com/#3JBK76#2)

---

<div class="post-metadata">

**Author:** ![bjornbacklund](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bjornbacklund/32/14097_2.png) [@bjornbacklund](https://forum.babylonjs.com/u/bjornbacklund)\
**Post date:** [April 6, 2022, 8:47am UTC](https://forum.babylonjs.com/t/babylon-actionmanager-for-mesh-in-utilitylayerscene-not-working/27825/13 "2022-04-06T08:47:02Z")

</div>

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](https://playground.babylonjs.com/#3JBK76#3)  
Not sure if anything else will break if I don’t send the UtilityRenderer.  
Thanks again,  
—bjorn
