UMG and multiple controllers
I'm in the process of building a menu system for my game, and so far I have most of the work done; the menu is basically a player ready screen for a local multiplayer game I'm making.
Each player joins the game by pressing A on their gamepad, and can optionally back out by pressing B once joined. Here's the blueprint script I'm using to grab the controller input.
The problem is this: The gamepad input only works for player one at the moment. I must be missing something somewhere, but I can't work out what I'm doing incorrectly.
Does anybody have any experience with this or any clue as to the problem I'm having?
Thanks for reading,
asked Oct 22 '14 at 07:39 PM in Blueprint Scripting
I have not done any new research with UE 4.5 but with UE 4.4 you would not get any controller input if no player had been created to use that controller.
So the only way was to subclass UGameViewportClient in C++ and override the InputKey() method where all input is routed to.
See the snippet to demonstrate the usage below.
answered Oct 23 '14 at 12:55 PM
I'm trying to achieve the same sort of results, is there anyway you can post a screen shot of your blueprint with the event dispatchers. 4.6 didn't really seem to resolve this as far as I can tell.
answered Dec 05 '14 at 09:59 AM
Hey guys, I may be a bit late to the party but I noticed I was still having this problem in 4.7.6 and this was one of the questions I came across while trying to find a solution. I too was trying to have the "Press A to join" system for local players.
The issue I was experiencing is when Keyboard Focus is set, only player 1 (index 0) would be able to interact with the menu. All other game input was being blocked. I even tried the overriding of GameViewport input but the input from the other three controllers never made it there. We'll I found a solution that worked for me after investigating what "Set Focus Keyboard" was doing.
Set Keyboard Focus only sets the focus for the User at index 0 as it just calls SetUserFocus() and passes in GetUserIndexForKeyboard(). Since SetUserFocus isn't a blueprint function, I added my own UserWidget class and made it the parent of my Main Menu. In there I added a function "SetUserFocus" that takes a UserId and then calls: FSlateApplication::Get().SetUserFocus(UserId, SafeWidget);
I made it blueprint callable and just call it on all my Controllers when I load the UMG.
Hopefully this will help anyone else who's having this problem as I was banging my head against the wall for some time.
answered Apr 27 '15 at 09:19 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here