I have a local splitscreen multipayer game. When there is more than one player at the start of the level, only player 1 receives input from their gamepad; none of the other players will receive input from their gamepads.
The weird thing is that if I left click on the mouse, then everything functions normally; but until I left click only player 1 gets input.
Anyone have an idea as to why players 2, 3, and 4 aren’t getting input from their gamepad until I left click with my mouse?
windows focus. a windows that have no focus will not receive input. that is how a computer prevent all kind of weird stuff from happening, for exemple you do not want your web browser to receive keyboard inout when you type on skype right? same thing.
Make sure you have it set up correct, go to Edit -> Editor Preferences -> Play (in the Level Editor section) then make sure “Game Gets Mouse Control” is enabled. With option enabled it should not require you to click before playing.
I set “Game Gets Mouse Control” to true, but didn’t change anything. I can always control player 1, it’s players 2, 3, and 4 that I can’t control until I left-click, or right-click, the mouse. happens both in PIE mode and in a build of the game.
I’m creating my game’s main menu; in it, I start with one player, but create players at a certain point along the UI’s flow.
If I launch the game, and just use the player 1 gamepad to control the UI, when I get to the point of other players being created, only player 1 receives input from their gamepad. No other players receive input. is just like before.
However, if I click the mouse, even before any additional players are created, when the other players are created they do receive input from their gamepads.
And, if I then load another map, players on the newly loaded map (which in the interim the players have been destroyed in the previous map, and then created again in the new map) are still receiving input from their gamepads.
In light of , I have a workaround; I’m going to force players to left-click their mouse in order to get past the first screen in the menu UI. That way players should correctly receive input from their gamepads.
What I ended up doing was still forcing the player to press a button to get past the first screen of the UI, but instead of a click it is now responding to the Start button on the gamepad; and when the player presses Start I call [FONT=Lucida Console]SetFocusToGameViewport. fixes the problem.
It’s worth noting though that the will happen again whenever focus leaves the viewport; so if a player Alt-Tab’s away and back to the game, then [FONT=Lucida Console]SetFocusToGameViewport will need to get called again.
My specific was giving the player “set input mode game only”, after the pawn is possessed, needing to be owning-client replicated (non-replicated, or server, both broke any pawn past the first player).