So the PG detects the controller fine and gets its initial values for the sticks, but then after that no more updates go to the controller?
Also if I disconnect the controller five disconnect observables are fired then if I reconnect it five connect observables are fired. Not sure if this is just happening for DualSense or all controllers.
Thinking this is a bug, but I might be mistaken so I’m moving it to questions until confirmation.
So it looks like the HTML5 API for controllers is doing the same thing, I was able to get around the multi events firing by checking a map for the gamepad, but the axes still dont update?
Hey @Pryme8, so I think I know what’s going on. So the PS5 controller is supported by the DeviceSourceManager but hasn’t had full support added to the GamepadManager yet. I didn’t want to add it as I was planning on refactoring the GamepadManager to use the DeviceSourceManager, instead of working as an independent input system. The reason I suspect that it’s working is because it’d being treated as a DualShock controller and they share similarities in how their buttons are mapped.
Basically, you’d need to add code to the DeviceSourceManager’s onDeviceConnected/DisconnectedObservables to handle setting up your DualSense controllers and then add to the scene’s onBeforeRenderObservable to make sure that it’s checking status on each frame (by default, there is no event based input handling for Gamepads, outside of what we’ve implemented in the GamepadManager). Here’s an example that’s based off of the PG that you provided previously: Babylon.js Playground (babylonjs.com)
It’s should be noted that this assumes that you’ll be using only one gamepad so logic may have to be put into place to handle additional gamepads.