# Right handed camera is flipped when parented

**URL:** <https://forum.babylonjs.com/t/right-handed-camera-is-flipped-when-parented/59357>\
**Category:** Questions\
**Tags:** camera\
**Created:** [July 3, 2025, 5:15pm UTC](https://forum.babylonjs.com/t/right-handed-camera-is-flipped-when-parented/59357 "2025-07-03T17:15:10Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![CrashMaster](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/crashmaster/32/23662_2.png) [@CrashMaster](https://forum.babylonjs.com/u/CrashMaster)\
**Post date:** [July 3, 2025, 5:15pm UTC](https://forum.babylonjs.com/t/right-handed-camera-is-flipped-when-parented/59357/1 "2025-07-03T17:15:10Z")

</div>

Hey there,

I upgraded my dependencies recently and came accross this breaking change which makes right handed target cameras rotation flipped on the Y axis when using a right handed system:

> [@Breaking change in target camera rotations when using right-handed system](https://forum.babylonjs.com/t/breaking-change-in-target-camera-rotations-when-using-right-handed-system/58753):
>
> Starting with version [8.10.1](https://www.npmjs.com/package/@babylonjs/core/v/8.10.1), any code that modifies the rotation or rotationQuaternion property of a target camera when the scene is in right-handed system (i.e., scene.useRightHandedSystem = true) will behave exactly 180° flipped on the Y axis than before. This is due to a bug with the target camera code that fails to take the handedness of the scene into account. See [RH camera fixes by bghgary · Pull Request #16691 · BabylonJS/Babylon.js](https://github.com/BabylonJS/Babylon.js/pull/16691) for details. For additional back story, we ran into th…

This creates 2 issues for my setup of a camera parented to a `TransformNode`:

- Camera rotation with mouse is inverted on the Y axis =\> I fixed it by inverting the camera quaternion x component
- Camera is not pointing in the same direction as its parent

For the second issue, I made the following PG. The idea is to transfer the rotation quaternion of the camera to its parent every frame to ensure the transform and camera forward direction are aligned. It works in left handed, but in right handed, the camera forward is the opposite of the transform forward 😕

> **[Babylon.js Playground](https://playground.babylonjs.com/#6XB1RH%2311)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL and WebGPU 3D scenes

Any idea what I could be missing to flip it around?

I have tried adding an additional PI around the Y axis to turn it around, but it did not work:

> **[Babylon.js Playground](https://playground.babylonjs.com/#6XB1RH%2310)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL and WebGPU 3D scenes

---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [July 3, 2025, 6:55pm UTC](https://forum.babylonjs.com/t/right-handed-camera-is-flipped-when-parented/59357/2 "2025-07-03T18:55:35Z")

</div>

Assigned @bghgary on July 3, 2025, 6:55pm UTC



---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [July 3, 2025, 6:55pm UTC](https://forum.babylonjs.com/t/right-handed-camera-is-flipped-when-parented/59357/3 "2025-07-03T18:55:47Z")

</div>

I will investigate soon. Thanks for the report!

---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [July 3, 2025, 10:29pm UTC](https://forum.babylonjs.com/t/right-handed-camera-is-flipped-when-parented/59357/4 "2025-07-03T22:29:53Z")

</div>

> [@CrashMaster](#):
>
> Camera rotation with mouse is inverted on the Y axis =\> I fixed it by inverting the camera quaternion x component

This is a bug. I have a [PR](https://github.com/BabylonJS/Babylon.js/pull/16849) out to fix it, but I need to test it a bunch and maybe add some tests before it can be merged.

> [@CrashMaster](#):
>
> For the second issue, I made the following PG. The idea is to transfer the rotation quaternion of the camera to its parent every frame to ensure the transform and camera forward direction are aligned. It works in left handed, but in right handed, the camera forward is the opposite of the transform forward 😕

This one is trickier. In RH, the camera at identity rotation faces -Z. In order to make everything work, we have to move all the objects to the other side of Z. In addition, the transform node’s lookAt function assumes +Z is forward. We can maybe add a parameter for this, but for now, it needs to be updated by hand to match what an RH camera would do. Here is a PG with the bug fix from the PR that works in both LH and RH:  
[https://playground.babylonjs.com/?snapshot=refs/pull/16849/merge#6XB1RH#12](https://playground.babylonjs.com/?snapshot=refs/pull/16849/merge#6XB1RH#12). Let me know if you have any questions.

---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [July 3, 2025, 10:35pm UTC](https://forum.babylonjs.com/t/right-handed-camera-is-flipped-when-parented/59357/5 "2025-07-03T22:35:46Z")

</div>

I also want to point out that transferring rotations from a child to parent will cumulate errors in the long run due to floating point imprecision. If the goal is to put the camera rotation on a transform node instead of the camera itself, it might be better to introduce custom camera input code.

---

<div class="post-metadata">

**Author:** ![CrashMaster](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/crashmaster/32/23662_2.png) [@CrashMaster](https://forum.babylonjs.com/u/CrashMaster)\
**Post date:** [July 4, 2025, 7:20am UTC](https://forum.babylonjs.com/t/right-handed-camera-is-flipped-when-parented/59357/6 "2025-07-04T07:20:03Z")

</div>

Thanks for investigating! So the transform lookAt working in RH in previous versions was a bug if I understand correctly?

I don’t mind the additional quaternion multiplication, it works for me 👍

> [@bghgary](#):
>
> In addition, the transform node’s lookAt function assumes +Z is forward. We can maybe add a parameter for this, but for now, it needs to be updated by hand to match what an RH camera would do

As the transform has a reference to the scene, it can get the scene handedness without the need for an additional parameter maybe 🤔

> [@bghgary](#):
>
> transferring rotations from a child to parent will cumulate errors in the long run due to floating point imprecision. If the goal is to put the camera rotation on a transform node instead of the camera itself, it might be better to introduce custom camera input code.

My goal is to have a camera that can move with 6 degrees of freedom while retaining the nice controls of the BJS camera so I ended up with this ^^ If you know a better way of implementing this kind of movement I am interested 🙂

---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [July 7, 2025, 5:12pm UTC](https://forum.babylonjs.com/t/right-handed-camera-is-flipped-when-parented/59357/7 "2025-07-07T17:12:07Z")

</div>

> [@CrashMaster](#):
>
> So the transform lookAt working in RH in previous versions was a bug if I understand correctly?

`lookAt` assumes a convention of +Z forward. I’m not sure I would consider this a bug. It’s just a convention that doesn’t match the camera.

> [@CrashMaster](#):
>
> As the transform has a reference to the scene, it can get the scene handedness without the need for an additional parameter maybe

I’m not sure that’s the right thing to do. It will be another breaking change if we do it, so we have to be careful.

> [@CrashMaster](#):
>
> My goal is to have a camera that can move with 6 degrees of freedom while retaining the nice controls of the BJS camera so I ended up with this ^^ If you know a better way of implementing this kind of movement I am interested

Maybe you can use the `upVector` for the Z rotation? [Babylon.js Playground](https://playground.babylonjs.com/#48Q51D)

---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [July 7, 2025, 5:50pm UTC](https://forum.babylonjs.com/t/right-handed-camera-is-flipped-when-parented/59357/8 "2025-07-07T17:50:30Z")

</div>

Unassigned @bghgary on July 7, 2025, 5:50pm UTC



---

<div class="post-metadata">

**Author:** ![CrashMaster](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/crashmaster/32/23662_2.png) [@CrashMaster](https://forum.babylonjs.com/u/CrashMaster)\
**Post date:** [July 8, 2025, 6:56am UTC](https://forum.babylonjs.com/t/right-handed-camera-is-flipped-when-parented/59357/9 "2025-07-08T06:56:25Z")

</div>

> [@bghgary](#):
>
> `lookAt` assumes a convention of +Z forward. I’m not sure I would consider this a bug. It’s just a convention that doesn’t match the camera.

I find it a bit weird that in RH, `lookAt` does not “look at” the given position and instead “looks away” 🤔 Maybe we could have a `lookAtRightHanded` function instead that works for RH?

> [@bghgary](#):
>
> I’m not sure that’s the right thing to do. It will be another breaking change if we do it, so we have to be careful.

I was just thinking out loud, let me know if you change something 😉

> [@bghgary](#):
>
> Maybe you can use the `upVector` for the Z rotation? [Babylon.js Playground](https://playground.babylonjs.com/#48Q51D)

As you can see in your PG, rotating the up vector does not update the rotation axis of the camera for mouse inputs, which is another reason why I use the parent transform:

---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [July 8, 2025, 9:54pm UTC](https://forum.babylonjs.com/t/right-handed-camera-is-flipped-when-parented/59357/10 "2025-07-08T21:54:31Z")

</div>

> [@CrashMaster](#):
>
> I find it a bit weird that in RH, `lookAt` does not “look at” the given position and instead “looks away” 🤔 Maybe we could have a `lookAtRightHanded` function instead that works for RH?

It doesn’t look away, it changes the node such that +Z points at the target in both LH and RH. It appears to look away for this scenario this because the camera faces -Z. It’s a conventions issue. I agree it’s not super consistent though.

> [@CrashMaster](#):
>
> As you can see in your PG, rotating the up vector does not update the rotation axis of the camera for mouse inputs, which is another reason why I use the parent transform:

I see. We can maybe alter the camera input math in core with a flag or use custom inputs.

---

<div class="post-metadata">

**Author:** ![CrashMaster](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/crashmaster/32/23662_2.png) [@CrashMaster](https://forum.babylonjs.com/u/CrashMaster)\
**Post date:** [July 9, 2025, 7:23am UTC](https://forum.babylonjs.com/t/right-handed-camera-is-flipped-when-parented/59357/11 "2025-07-09T07:23:11Z")

</div>

> [@bghgary](#):
>
> It doesn’t look away, it changes the node such that +Z points at the target in both LH and RH. It appears to look away for this scenario this because the camera faces -Z

Thanks for the clarification, it makes sense ^^

> [@bghgary](#):
>
> I see. We can maybe alter the camera input math in core with a flag or use custom inputs.

Probably yes, but that seems like a lot of effort for a use case that is not often used, hence using a parent transform to take care of this complexity 🤔

---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [July 9, 2025, 7:48pm UTC](https://forum.babylonjs.com/t/right-handed-camera-is-flipped-when-parented/59357/12 "2025-07-09T19:48:48Z")

</div>

> [@CrashMaster](#):
>
> Probably yes, but that seems like a lot of effort for a use case that is not often used, hence using a parent transform to take care of this complexity

Sure, it just has problems. Try moving the camera in the playground of the OP back and forth a bunch of times. It will eventually start drifting.

---

<div class="post-metadata">

**Author:** ![CrashMaster](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/crashmaster/32/23662_2.png) [@CrashMaster](https://forum.babylonjs.com/u/CrashMaster)\
**Post date:** [July 10, 2025, 6:59am UTC](https://forum.babylonjs.com/t/right-handed-camera-is-flipped-when-parented/59357/13 "2025-07-10T06:59:33Z")

</div>

> [@bghgary](#):
>
> It will eventually start drifting.

True, but you could also say I accidentally implemented a trackball camera 😆

---

<div class="post-metadata">

**Author:** ![Fli](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/fli/32/39484_2.png) [@Fli](https://forum.babylonjs.com/u/Fli)\
**Post date:** [July 22, 2025, 7:43am UTC](https://forum.babylonjs.com/t/right-handed-camera-is-flipped-when-parented/59357/14 "2025-07-22T07:43:34Z")

</div>

Hello,

I’m experiencing similar issues, but I noticed this post doesn’t mention anything about the WebXR experience being inverted.

I’ve recently updated the Babylon.js version in my project to 8.16.1. I’m using the `WebXRDefaultExperience` with an `xrCamera`.

When using the right-handed (RH) system, the `xrCamera` behaves like the `FreeCamera`.  
Tilting your head upwards (in real life) causes the camera to look downwards, and vice versa.

In the solution PR, I see updates for the `mouseInput` and `touchInput`. Should the `xrCamera` also have its inputs updated?

---

<div class="post-metadata">

**Author:** ![CrashMaster](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/crashmaster/32/23662_2.png) [@CrashMaster](https://forum.babylonjs.com/u/CrashMaster)\
**Post date:** [July 22, 2025, 4:47pm UTC](https://forum.babylonjs.com/t/right-handed-camera-is-flipped-when-parented/59357/15 "2025-07-22T16:47:15Z")

</div>

> [@Fli](#):
>
> Tilting your head upwards (in real life) causes the camera to look downwards, and vice versa.

That’s some massive motion sickness material right there 😆

---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [August 1, 2025, 3:20pm UTC](https://forum.babylonjs.com/t/right-handed-camera-is-flipped-when-parented/59357/16 "2025-08-01T15:20:20Z")

</div>

Sorry, I was on vacation when you sent this. Do you have a repro we can test?

---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [August 1, 2025, 3:20pm UTC](https://forum.babylonjs.com/t/right-handed-camera-is-flipped-when-parented/59357/17 "2025-08-01T15:20:52Z")

</div>

Assigned @bghgary on August 1, 2025, 3:20pm UTC



---

<div class="post-metadata">

**Author:** ![Fli](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/fli/32/39484_2.png) [@Fli](https://forum.babylonjs.com/u/Fli)\
**Post date:** [August 5, 2025, 1:33pm UTC](https://forum.babylonjs.com/t/right-handed-camera-is-flipped-when-parented/59357/18 "2025-08-05T13:33:09Z")

</div>

Hello,

The issue with inverted inputs on the Universal Camera when using the RH system has been resolved for me after updating to Babylon.js version **8.21.0**.

I’ve tested the **WebXR experience** and found that the problem still persists there when using the RH system. To demonstrate this, I’ve created this playground example.

> **[Babylon.js Playground](https://playground.babylonjs.com/#4EGO4T)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL and WebGPU 3D scenes

I’m using a **Meta Quest 2** as my VR device.

---

<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:** [August 5, 2025, 3:30pm UTC](https://forum.babylonjs.com/t/right-handed-camera-is-flipped-when-parented/59357/19 "2025-08-05T15:30:16Z")

</div>

cc @docEdub

---

<div class="post-metadata">

**Author:** ![docEdub](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/docedub/32/14525_2.png) [@docEdub](https://forum.babylonjs.com/u/docEdub)\
**Post date:** [August 5, 2025, 11:57pm UTC](https://forum.babylonjs.com/t/right-handed-camera-is-flipped-when-parented/59357/20 "2025-08-05T23:57:38Z")

</div>

WebXR camera is fixed by [PR 16974](https://github.com/BabylonJS/Babylon.js/pull/16974).

Thanks for reporting this!

[Next page](https://forum.babylonjs.com/t/right-handed-camera-is-flipped-when-parented/59357.md?page=2)
