After adding VR mode my touch event not working at all in my mobile

After adding VR mode my touch event not working at all in my mobile

http://snvdev.website/html/arvr/
I tried to put code in playstore .
https://www.babylonjs-playground.com/#UI959B

when i move/rotate mobile left or right up or down everything works fine the photodome moves/ camera rotates . but when i use my finger in mobile device for rotating camera it does not work.

help is really appreciated.

Hey and welcome!
pinging @trevordev our VR overlord

Welcome Amit,

Did this work as expected in the past? I recently fixed a bug this week (reproable on stable Babylon.js Playground ) which caused the camera to jump when the user touched the screen that disabled touch input if the orientation sensor is used. Another user requested the ability to still be able to scroll horizontally when the orientation sensor is active so I created a PR which is still in progress here (option to enable horizontal dragging when orientation camera is using… by TrevorDev · Pull Request #6052 · BabylonJS/Babylon.js · GitHub). Would this work for your scenario as well?

Thanks trevordev ,

  1. when i scroll on vr window it moves a bit but then it fall backs to its original postion .
  2. should i go back and make again babylon.custom.js . to get this facility.
  3. If you are still developing this feature can you please make an option something like
    var vrHelper = scene.createDefaultVRExperience();
    vrHelper .touch = true;
    so that people can be able ,when/if they need touch or not.

Sure, I can add a way to allow the original behavior you desire

It will work via this pg once the a PR is merged.
https://playground.babylonjs.com/#UQ2AYT#1

Note that multiple users mentioned that this behavior was not expected.

“It will work via this pg once the a PR is merged.” --is it merged . As Its still not working.
http://snvdev.website/wp/newarvr/

var vrHelper = scene.createDefaultVRExperience();
vrHelper.enableInteractions();
vrHelper.deviceOrientationCamera.disablePointerInputWhenUsingDeviceOrientation = false;
vrHelper.onNewMeshSelected.add(function(mesh) {
console.log(mesh);
select = 1;
console.log(mesh);
});

kindly help me here

@Amit_Sharma
It looks to be supporting touch for me. Without

vrHelper.deviceOrientationCamera.disablePointerInputWhenUsingDeviceOrientation = false;

touch input does nothing, after adding it, it has the same behavior as on stable. Is this not what you expected?

Hi @trevordev, I guess @Amit_Sharma missed the main issue which we are facing.
I explain here: https://playground.babylonjs.com/#UQ2AYT#1 . Review this link on mobile and start dragging, things via fingers and then you will realize that the pointer, got changed, where it was actually left.

touch works but it reset it back to same position it is not moving dome camera to new place.

http://snvdev.website/wp/newarvr/

Will this playground work? https://playground.babylonjs.com/#UQ2AYT#3 . This only supports horizontal motion, supporting both directions causes unexpected behavior as well because when the device orientation is rotated while scrolling in a given direction the rotation gets off axis. You could try to listen to scene.OnPointerObservable and window.addEventListener(“orientationchange”, (e)=>{}) to modify a camera manually

Can we have a call, so I can explain or show you the working things. skype I guess would be better. @trevordev

https://playground.babylonjs.com/#UQ2AYT#4

window.addEventListener(“touchmove”, function(evt){
vrHelper.deviceOrientationCamera.cameraRotation.x +=0.1;
}, false);

the pointer is getting reset back to original position when i run in mobile chrome webbrowser. why ?

Because the device orientation will overwrite the camera’s position with the device orientation. To get custom behavior you can try using a free camera and disable the creation of the device orientation camera in the helper.

https://playground.babylonjs.com/#UQ2AYT#5

I will also remove the disablePointerInputWhenUsingDeviceOrientation api since it does not work as expected

If you want to get on a call dm me when you are online 1 - 5pm PST works best for me.

hi there ,
When i use this android in mobile view only it enables horizontal direction. vertical touch move does not work as function says
vrHelper.deviceOrientationCamera.enableHorizontalDragging();
but When i see my website in IOS( Apple Iphone). it doesnot need
vrHelper.deviceOrientationCamera.enableHorizontalDragging();
its horizonal and virtical touch move both are working .

Also WEBVR not working in IOS mobiles . Kindly help me here .

I just tried on an iphone 8 plus and it seemed to work.

Only entering WebVR and horizontal scrolling worked here: https://playground.babylonjs.com/#UQ2AYT#3

Were you trying on the playground? Maybe for some caching reason you were using the older babylon version or maybe Im misunderstanding the issue you are seeing.

I tried on iphone 7 and up-down dragging are not working. Can you please guide me or look into my code please.
That’s my URL: http://snvdev.website/wp/newarvr/.

Iphone6, iphone6s have same issues.