Why is orbitControls not working on mobile device

84 views Asked by At

I am running THREE.js and am attempting to build a 360 video viewer that works on mobile devices, however orbitControls isn't working at all on my phone, it works perfectly fine when on PC

I've tried to research and find someone with this issue but no one seems to answer it. I've seen things that say that it should work but nothing I do works.

https://jsfiddle.net/wmorris01/3ctv9hdL/2/

controls = new THREE.OrbitControls(camera, renderer.domElement)
controls.enabled = true
controls.touches.ONE = THREE.TOUCH.PAN
controls.touches.TWO = THREE.TOUCH.DOLLY_ROTATE
1

There are 1 answers

5
Łukasz D. Mastalerz On

Do you have specific reason to use r128?

2. You don't need "THREE"

controls = new THREE.OrbitControls(camera, renderer.domElement)

set like this

controls = new OrbitControls( camera, renderer.domElement);

Set this tag

<meta name="viewport" content="width=device-width, initial-scale=1.0">

And your question about Live Server, well, I don't know. I use bundler (Vite), and you should try either.