# CameraGizmo changes maxZ every time it shows

**URL:** <https://forum.babylonjs.com/t/cameragizmo-changes-maxz-every-time-it-shows/57966>\
**Category:** Bugs\
**Tags:** gizmo, camera\
**Created:** [April 21, 2025, 7:05am UTC](https://forum.babylonjs.com/t/cameragizmo-changes-maxz-every-time-it-shows/57966 "2025-04-21T07:05:24Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![kzhsw](https://avatars.discourse-cdn.com/v4/letter/k/848f3c/32.png) [@kzhsw](https://forum.babylonjs.com/u/kzhsw)\
**Post date:** [April 21, 2025, 7:05am UTC](https://forum.babylonjs.com/t/cameragizmo-changes-maxz-every-time-it-shows/57966/1 "2025-04-21T07:05:25Z")

</div>

Engine: WebGL2  
Version: 8.3.1  
Playground: any

Steps to reproduce:

1. Open empty playground: [https://playground.babylonjs.com/](https://playground.babylonjs.com/)
2. Open Inspector
3. Click camera
4. Click “Turn on/off the camera’s gizmo”
5. Watch value of “Far plane”

Expected: value of “Far plane” not changed

Actual:  
 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/2/3/2384118febedc9c9cfcd6be724920bd2bfefe408.gif)

Related code ([Introduced ~5 years ago](https://github.com/BabylonJS/Babylon.js/commit/f17517da47f6516e82a2c30083b862328ffa5dc9)):

> <https://github.com/BabylonJS/Babylon.js/blob/39e6834ef6d2aa6f36dba748024d450cdff6edca/packages/dev/core/src/Gizmos/cameraGizmo.ts#L112>

---

<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:** [April 21, 2025, 4:19pm UTC](https://forum.babylonjs.com/t/cameragizmo-changes-maxz-every-time-it-shows/57966/2 "2025-04-21T16:19:19Z")

</div>

cc @Cedric

---

<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 22, 2025, 8:05am UTC](https://forum.babylonjs.com/t/cameragizmo-changes-maxz-every-time-it-shows/57966/3 "2025-04-22T08:05:40Z")

</div>

> <https://github.com/BabylonJS/Babylon.js/pull/16517>
>
> https://forum.babylonjs.com/t/cameragizmo-changes-maxz-every-time-it-shows/57966

---

<div class="post-metadata">

**Author:** ![kzhsw](https://avatars.discourse-cdn.com/v4/letter/k/848f3c/32.png) [@kzhsw](https://forum.babylonjs.com/u/kzhsw)\
**Post date:** [April 26, 2025, 6:52am UTC](https://forum.babylonjs.com/t/cameragizmo-changes-maxz-every-time-it-shows/57966/5 "2025-04-26T06:52:18Z")

</div>

Thank you for the fix, but if 2 camera is created, and showing the `CameraGizmo` of one camera while the other camera is active, the active camera’s maxZ will be changed. Is this something expected? Why should there be this behavior?  
 ![screenrecording](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/2/a/2ad4baa4c29d4d5a84c0d3eff415d9d8217d143a.gif)

---

<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:** [April 29, 2025, 5:51pm UTC](https://forum.babylonjs.com/t/cameragizmo-changes-maxz-every-time-it-shows/57966/6 "2025-04-29T17:51:32Z")

</div>

Can you share a repro so that @Cedric will have a look when coming back from vacation.

---

<div class="post-metadata">

**Author:** ![kzhsw](https://avatars.discourse-cdn.com/v4/letter/k/848f3c/32.png) [@kzhsw](https://forum.babylonjs.com/u/kzhsw)\
**Post date:** [April 30, 2025, 5:13am UTC](https://forum.babylonjs.com/t/cameragizmo-changes-maxz-every-time-it-shows/57966/7 "2025-04-30T05:13:28Z")

</div>

Ok.  
Steps to reproduce:

1. Open the empty playground [https://playground.babylonjs.com/](https://playground.babylonjs.com/)
2. Open Inspector
3. Right click on “Nodes” - “Add new free camera”
4. Click “camera1”, the value of “Far plane” should be 10000
5. Click “Turn on/off the camera’s gizmo” of “free camera”, the newly created camera
6. Watch value of “Far plane” changes (Current selected node is still “camera1”)

Expected: value of “Far plane” not changed  
Actual: the image above [CameraGizmo changes maxZ every time it shows - #5 by kzhsw](https://forum.babylonjs.com/t/cameragizmo-changes-maxz-every-time-it-shows/57966/5)

---

<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:** [May 12, 2025, 9:15am UTC](https://forum.babylonjs.com/t/cameragizmo-changes-maxz-every-time-it-shows/57966/8 "2025-05-12T09:15:35Z")

</div>

Assigned @Cedric on May 12, 2025, 9:15am UTC



---

<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:** [May 12, 2025, 9:19am UTC](https://forum.babylonjs.com/t/cameragizmo-changes-maxz-every-time-it-shows/57966/9 "2025-05-12T09:19:53Z")

</div>

I’ll take a look shortly!

---

<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:** [May 12, 2025, 5:08pm UTC](https://forum.babylonjs.com/t/cameragizmo-changes-maxz-every-time-it-shows/57966/10 "2025-05-12T17:08:23Z")

</div>

> <https://github.com/BabylonJS/Babylon.js/pull/16588>
>
> I browsed history but could not get the reason for that particular bug. Why the …fix was valid in the first place or the meaning of the 1.5 value.
> This PR removes it in the hope bug will re-surface and a proper fix will be done.
> 
> https://forum.babylonjs.com/t/cameragizmo-changes-maxz-every-time-it-shows/57966/6

---

<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:** [May 14, 2025, 1:58pm UTC](https://forum.babylonjs.com/t/cameragizmo-changes-maxz-every-time-it-shows/57966/11 "2025-05-14T13:58:27Z")

</div>

Unassigned @Cedric on May 14, 2025, 1:58pm UTC


