Adding VR controls and Joystick controls

Hello, I want to add virtual joystick and VR hand controller buttons to my scene. And also want to detect the device. That is the device is touchscreen/ mobile then It will show a joystick and if the person wants to use VR then they can get hand controller enabled features. Can anyone suggest how can I integrate those with my camera WASD controls?

@PolygonalSun do you know of a standard way to detect if it’s a touchscreen/mobile device?

No, I explored little bit so get something according to width but not much.

The XR camera and your default camera are two different entities. If XR is available, the user will be allowed to enter XR an use the XR controllers. Otherwise, the user will use the default camera controllers, which you are in charge of. It can e set using he keyboard (WASD), can be set using a virtual joystick (if mobile was detected). It’s all your choice the dev

Ok, then please give me one reference how can I detect device and … use xr camera

WebXR | Babylon.js Documentation (


I’ll check and let you know :slightly_smiling_face:

1 Like