Last night all was fine, came back to continue working on my project tonight and suddenly PlayCanvas is throwing these errors with USB game device attached:
caught TypeError: Cannot read property ‘pad’ of undefined
at GamePads.update (playcanvas-stable.dbg.js:18314)
at Application.update (playcanvas-stable.dbg.js:20503)
at playcanvas-stable.dbg.js:20829
100% repro on a brand new empty project
Tested in Chrome and Edge
Error triggered when input is detected from game device
Tested on two PCs with same result
Errors with either or both of the following USB game devices attached: MS 360 gamepad, Fanatec Clubsport peddles.
Have loaded up html5gamepad.com to check device and everything seems to o.k
I’m at a real loss here, any help appreciated!
Additional:
Unplugged all USB game devices so I could carry on working on other functionality and the same error was still being thrown on launch. html5gamepad.com and Windows USB devices were all showing nothing connected. Had to restart browser and this seemed to stop error (with no gamepad connected, reconnecting generates error again).
So, I’ve just got into work (different PC, gamepad), launched the empty project in a new browser window (link below) and immediately hitting the same error as soon as I nudge one of the controller sticks. I don’t get it, it’s a brand new empty project with no code
@dave is right - looks like it’s my fault. I’m sorry this is stifling your work @matts.
I do know what the problem is (it seems a last minute change caused the gamepad update method to essentially stop working). I’ll make a pull request to fix it shortly. Although when it gets released will depend on the PlayCanvas team.
Hi there, apologies for not getting back sooner it’s been a busy week.
I’m not certain that things are working entirely as they should, or at least something about how gamepad data is returned has changed. I’m now getting this error:
[playcanvas-stable.dbg.js:18368]: Cannot read property ‘0’ of undefined