Search Issue Tracker
Fixed
Fixed in 1.11.1, 7000.0.0
Votes
0
Found in [Package]
1.6.1
Issue ID
ISXB-1020
Regression
No
[WebGL] Input stops working when 2 Player Input Components are in the Scene
How to reproduce:
1. Open the attached Project "inputTest"
2. Build and Run the Scene "GameplayScene" on WebGL
3. Open the browser's Console
4. Focus the WebGL Player
5. Press the "A" key on the Keyboard
6. Observe the browser's Console
Expected result: "-1" and "0" can be seen logged in the Console
Actual result: Nothing is logged in the Console
Reproducible with: 1.6.1 (2021.3.28f1, 2022.3.4f1, 2023.1.3f1, 2023.2.0a23)
Reproduced on:
- Google Chrome (Version 114.0.5735.198)
Did not reproduce on:
- Unity Editor (MacOS Intel)
- Unity Player (MacOS Intel)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Shader transparency, discard, and clip are not working when using the Player
- Error is thrown when clicking on warning in the console
- Long IL2CPP build time when project has a .ufbx library wrapper
- Cursor doesn't change to the resizing when using the Rect Tool and the Sprite is too close to the bottom of the Scene View
- InvalidOperationException exception is thrown when Editor Default Text Rendering Mode is set to "Bitmap" and Editor Font is set to "System Font" and an array is expanded in the Inspector Window
Resolution Note (fix version 7000.0.0):
Added message to notify the user if a PlayerInputComponent fails to bind a control scheme to help debug issues like this.
This can happen if there are multiple game objects with PlayerInputComponent's and not enough devices to support them
This issue isn't a WebGL specific issue.
Its due to the control scheme setup in the project.
The ControlScheme is setup to support both 'Keyboard&Mouse' or 'Touch'
On the PC setup there is only 'Keyboard&Mouse' present so its used for both the 'Player' and 'UIManager' gameObjects (which are both setup to use PlayerInputComponents with 'auto-switch' set on them).
On the WebGL setup there is Touch present too so this is auto assigned to one of the PlayerInputComponents, but there is no useful mapping set in the PlayerinputActions Input Action Asset to respond to the Touch (for UI/Move which responds to 'A' or for UI/Navigate which responds to 'A')
One solution is to delete the "Touch" control scheme from the PlayerinputActions
Resolution Note (fix version 1.11.1):
Added message to notify the user if a PlayerInputComponent fails to bind a control scheme to help debug issues like this.
This can happen if there are multiple game objects with PlayerInputComponent's and not enough devices to support them
This issue isn't a WebGL specific issue.
Its due to the control scheme setup in the project.
The ControlScheme is setup to support both 'Keyboard&Mouse' or 'Touch'
On the PC setup there is only 'Keyboard&Mouse' present so its used for both the 'Player' and 'UIManager' gameObjects (which are both setup to use PlayerInputComponents with 'auto-switch' set on them).
On the WebGL setup there is Touch present too so this is auto assigned to one of the PlayerInputComponents, but there is no useful mapping set in the PlayerinputActions Input Action Asset to respond to the Touch (for UI/Move which responds to 'A' or for UI/Navigate which responds to 'A')
One solution is to delete the "Touch" control scheme from the PlayerinputActions