# Setts of Gizmo color when events

**URL:** <https://forum.babylonjs.com/t/setts-of-gizmo-color-when-events/22271>\
**Category:** Questions\
**Created:** [July 9, 2021, 12:01pm UTC](https://forum.babylonjs.com/t/setts-of-gizmo-color-when-events/22271 "2021-07-09T12:01:05Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Johny\_Mickey](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/johny_mickey/32/24948_2.png) [@Johny\_Mickey](https://forum.babylonjs.com/u/Johny_Mickey)\
**Post date:** [July 9, 2021, 12:01pm UTC](https://forum.babylonjs.com/t/setts-of-gizmo-color-when-events/22271/1 "2021-07-09T12:01:05Z")

</div>

Hi, I’m using the class: AxisDragGizmo. Is there any way to prevent the color from changing when the mouse cursor hovers over the gizmo when I grab the gizmo …? Simply I want to have the same color of gizmo every time, thanks for your time.

---

<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:** [July 9, 2021, 12:43pm UTC](https://forum.babylonjs.com/t/setts-of-gizmo-color-when-events/22271/2 "2021-07-09T12:43:01Z")

</div>

There is no public accessor but you can do it by changing diffuseColor of the different materials:

[https://playground.babylonjs.com/#25M5MN](https://playground.babylonjs.com/#25M5MN)

check lines 25-27

---

<div class="post-metadata">

**Author:** ![Johny\_Mickey](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/johny_mickey/32/24948_2.png) [@Johny\_Mickey](https://forum.babylonjs.com/u/Johny_Mickey)\
**Post date:** [July 9, 2021, 12:59pm UTC](https://forum.babylonjs.com/t/setts-of-gizmo-color-when-events/22271/3 "2021-07-09T12:59:34Z")

</div>

Hi, thank you for your response. At first glance, it looks fantastical. The problem is that under the color red you can see white or gray color ☹ Who knows from where.

---

<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:** [July 9, 2021, 1:07pm UTC](https://forum.babylonjs.com/t/setts-of-gizmo-color-when-events/22271/4 "2021-07-09T13:07:20Z")

</div>

does it looks better with emissive color ?

```auto
gizmo._coloredMaterial.emissiveColor = BABYLON.Color3.Red();

```

---

<div class="post-metadata">

**Author:** ![Johny\_Mickey](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/johny_mickey/32/24948_2.png) [@Johny\_Mickey](https://forum.babylonjs.com/u/Johny_Mickey)\
**Post date:** [July 9, 2021, 1:12pm UTC](https://forum.babylonjs.com/t/setts-of-gizmo-color-when-events/22271/5 "2021-07-09T13:12:30Z")

</div>

> [@Cedric](#):
>
> `gizmo._coloredMaterial.emissiveColor = BABYLON.Color3.Red();`

☹ White color is still visible

 ![white and red gizmo](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/b/0/b05ebbb6dae4e90404adc2b6b27b6afee69b8d71.jpeg)

---

<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:** [July 9, 2021, 1:16pm UTC](https://forum.babylonjs.com/t/setts-of-gizmo-color-when-events/22271/6 "2021-07-09T13:16:22Z")

</div>

I don’t get any white on the gizmo.  
Same PG as I linked?

---

<div class="post-metadata">

**Author:** ![Johny\_Mickey](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/johny_mickey/32/24948_2.png) [@Johny\_Mickey](https://forum.babylonjs.com/u/Johny_Mickey)\
**Post date:** [July 9, 2021, 1:18pm UTC](https://forum.babylonjs.com/t/setts-of-gizmo-color-when-events/22271/7 "2021-07-09T13:18:02Z")

</div>

Yes, the same PG. You must play with it for a while (change angle of view, moving…) and you will see white ghost.

---

<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:** [July 9, 2021, 1:21pm UTC](https://forum.babylonjs.com/t/setts-of-gizmo-color-when-events/22271/8 "2021-07-09T13:21:36Z")

</div>

I got it once on on hover  
try this:

```auto
gizmo._hoverMaterial.specularColor = BABYLON.Color3.Red();

```

---

<div class="post-metadata">

**Author:** ![Johny\_Mickey](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/johny_mickey/32/24948_2.png) [@Johny\_Mickey](https://forum.babylonjs.com/u/Johny_Mickey)\
**Post date:** [July 9, 2021, 1:50pm UTC](https://forum.babylonjs.com/t/setts-of-gizmo-color-when-events/22271/9 "2021-07-09T13:50:49Z")

</div>

Yes, I tried various manipulations, but now it’s red, really red, thank you 🙂 If I can, I have one last question with the mentioned class: AxisDragGizmo . When creating an object:  
var gizmo = new BABYLON.AxisDragGizmo (new BABYLON.Vector3 (1,0,0), BABYLON.Color3.Red (), utilLayer);

Can I later enter a new direction vector, e. G .: in our case we have: 1, 0, 0 …I want change it to 2, 5, 2? Is there a way to change this vector after creating the object? Change to another coordinate? Thank you.

---

<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:** [July 9, 2021, 1:52pm UTC](https://forum.babylonjs.com/t/setts-of-gizmo-color-when-events/22271/10 "2021-07-09T13:52:53Z")

</div>

I don’t think so, you will have to dispose the gizmo and create a new one.
