Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gamepad is not updateing since v3.16.1 #4414

Closed
CipSoft-Components opened this issue Mar 8, 2019 · 5 comments
Closed

Gamepad is not updateing since v3.16.1 #4414

CipSoft-Components opened this issue Mar 8, 2019 · 5 comments

Comments

@CipSoft-Components
Copy link

Version

  • Phaser Version: 3.16.2 (since 3.16.1)
  • Operating system: Windows 10
  • Browser:

Description

Since version 3.16.1 the gamepad is not updated correctly. It only updates, if the mouse is moved. All phaser examples for the gamepad do no longer work correctly, if a version above 3.15.1 is selected.

Example Test Code

Here is a codepen with the phaser gamepad debug example, which uses the latest phaser version: https://codepen.io/anon/pen/momMWR

Additional Information

@madmarcel
Copy link

I've encountered the same issue on Linux, had to roll back to v3.15.1 for my project.

@Olliebrown
Copy link
Contributor

Olliebrown commented Apr 6, 2019

WORKAROUND
With the new event system in 3.16, the InputPlugin is not having its update() method called automatically every frame. This seems to be fine for keyboard events and it does still call for mouse events, however, it does NOT call on gamepad events, at all!

The easiest workaround (while not efficient) is to update the input plugin every frame. Somewhere near the top of your scene's update function just add this:
this.input.update()


I can confirm that this issues also exists on MacOS 10.14.4 under chrome 73 (ultimately, the bug seems to be universal). I'm going to investigate a bit for a workaround/fix.

UPDATE
Some quick observations:

  • in v3.15.1 the gamepadPlugin.update() function was called constantly (every frame)
  • in the current dev version the gamepadPlugin.update() function is not being called on gamepad input

I think this is the root of the problem. The update() of the gamepadPlugin seems to be setup to call whenever the inputManager's update calls so you can artificially force it to update by, say, moving the mouse around. If you do this (move the mouse around over the game window) while you press buttons on the game pad then the gamepads get refreshed and all the button and axis values work as expected.

Since GamepadPlugin.update() seems to be linked to InputPlugin.update(), I'm going to see if I can find out why it is not responding to gamepad input events.

@madmarcel
Copy link

adding
input: { queue: true }
to your game config seems to fix the issue...but not an ideal workaround

@AdamInTheOculus
Copy link

AdamInTheOculus commented Apr 8, 2019

@Olliebrown Thanks! I can confirm your workaround is successful. Adding this.input.update() at the top of update() fixes the issue.

On macOS 10.13.5 -- Firefox 66.0.2

@photonstorm
Copy link
Collaborator

Thank you for submitting this issue. We have fixed this and the fix has been pushed to the master branch. It will be part of the next release. If you get time to build and test it for yourself we would appreciate that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants