Using touch controls on the iPad on safari for my app works fine initially when I drag to rotate the camera. However it suddenly doesn’t detect the mouse up event? because the camera suddenly goes into an infinite loop/rotation and cannot be stopped by touching/dragging on the screen.
The following is the code used to initialize the camera. Any suggestion would be appreciated.
Hi guys, I was successfully able to solve this issue. The following are the steps I performed in case anyone also runs into a similar issue .
Issue: Using a universal camera in BabylonJS using touch in iPad to rotate the camera led to unexpected results and the camera would get stuck in a rotation loop.
Solution: The following are the steps to solve this issue:
Remove the default inputs on the camera and only add mouse input to allow for only movement interactions:
camera.inputs = new BABYLON.FreeCameraInputsManager(camera)
camera.inputs.addMouse(true)
After assigning a new input manager and input, attach camera control to the canvas:
camera.attachControl(canvas)
Add the following tags to your body and canvas DOM elements to ensure no iPad multi touch events cause issues with touch controls:
touch-action=“none” style=“touch-action: none;”