Jump to content

Gamepad in non-VR-environment


Recommended Posts

Hi folks,

I used the Easter holidays trying to put gamepad support to my tool (xbox 360 controller).

I startet playing around with PGs and trying to get along with code.

I found this PG that has a nice gamepad cam and doesn´t even need to use the BABYLON.GamepadManager:


And I found another PG that uses the BABYLON.GamepadManager:


For some reason, the second PG example works fine in Firefox but not in Chrome although both browsers detect my gamepad.

Chrome: Version 65.0.3325.181 (Offizieller Build) (64-Bit)

Firefox: 59.0.2 (64-Bit)

Chrome shows two textControls with one saying "connected: 0" although the other one shows the button click events.

But the sphere doesn't react to button clicks.

In Firefox I can move the sphere.


I don´t know weather this is a bug or not.

Can I combine GamePadCamera and button press events? PG available?

And I still didn´t get what the Gamepad.Manager is for, since gamepads are natively supported by browsers.

Am I missing something?








Link to comment
Share on other sites

Hey, for me the second playground is working in chrome and firefox. My chrome version is Version 65.0.3325.181 (Official Build) (64-bit) as well.

You can use the gamepad manager without the vr environment, see this PG https://www.babylonjs-playground.com/#ULL4ER#2 which should be working in all browsers. If you are still seeing this not work in chrome let me know.

The gamepad camera should be able to work with the gamepad api to get automatic support for moving the camera and then using the gamepad api to add custom button logic. Here is a  PG: https://playground.babylonjs.com/#EL7754

From my understanding Babylon's gamepad manager api was added to provide ease of use/consistency when using gamepads with babylon (eg. button observables, specific controller support like xbox). I believe there should be no issue if you choose to use the native browser APIs instead.

Hope this helps.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...