Recently I have tried to build shipping version of game and I am having issue with 2nd controller when I build game. If I play game from editor (PIE) it works fine.
I have created:
one actor that manages some things around map (lets call it ManagerActor). ManagerActor is set to automatically receives input from first player (player index 0; keyboard and gamepad 1)
Player2Controller that handles input actions defined in project; Also onBeginPlay controller finds ManagerActor and stores in variable; when receives input it makes appropriate call to ManagerActor
GameMode that will create player by calling CreatePlayer with ControllerID: -1 (auto assign); I have also set Player2Controller as default
Now problem is that Player2Controller is not receiving any input when I build game ready for shipping.
If I run game PIE it works without issues (that is only way it works).
If I run game also from editor, but in separate window then it also doesn’t work.
I have gone through many online tutorials that I have found for adding 2nd controller support, but I still have same issue.
Some things I have tried:
creating Player2Pawn; also tried with assiging to Player2Pawn custom controller: Player2Controler
creating Actor which will autoreceive input for player with index 1 (I have tried other indexes as well)
GameMode to spawn Player2Pawn and make Player2Controller to posses it
None of that fixed issue.
Everything is done in blueprints.
I have 2 gamepads (DS4 emulated with DS4Windows), both working without issues in other games.
EDIT: What I want to achieve is to have:
Player 1 to use keyboard and first gamepad
Player 2 to use second gamepad ← this doesn’t work
Thanks for advice, but my game is shared screen.
I do have 2 players, but I want Player 1 to use keyboard and first gamepad, Player 2 should use second gamepad. My issue is that only first gamepad works, while second doesn’t produce any input.
If I do as you shown in answer, then Player 2 receives input from first gamepad, but then Player 1 is forced to use keyboard only.