OrbitControls stop working when grouping camera for XR

I have just added my camera to a group so I can set its position in VR in the demo below:


VR works, which is great, but now OrbitControls doesn’t work.

Here’s the previous version where it worked:

Is it obvious to any of you why this stopped working? I assume it’s something I just don’t understand.


Oh, this is probably a clue (source)

object: (required) The camera to be controlled. The camera must not be a child of another object, unless that object is the scene itself.

So by placing the camera into a Group, I probably break it. To me, this implies that OrbitControls and positioning the VR camera are mutually exclusive. Is there some workaround?

1 Like

I haven’t come back to this project yet, but I’ve been thinking about solutions. Could I only put the camera in the group when entering VR mode? Or … could I have two cameras, one for 2D and one for 3D and switch between them?

Anyone has come up with a solution yet?

I still haven’t come back to this project. I was hoping someone more knowledgable would chime in.

Yeah use another camera until entering VR, or a potential sudo idea would be to have a ghost secondary camera with orbit controls on it and apply this ghost camera matrix to the parent group containing your primary camera (maybe?)

I think that you should not try to use “OrbitControls” when entering VR, and instead implement an alternate method of manipulating the scene that makes use of the VR controllers. GoogleEarth VR provides a good example of how a scene can be navigated with your controllers.

I implemented a custom solution in this project.
Game : Ball-VR
Source : Sean-Bradley/Ball-VR: A ball rolling experiment in VR (github.com)
You use the controllers to rotate around the ball, roll forward/backward and change direction.
Only tested on Quest (and dekstop).

Ball-VR Demo

1 Like