I’m setting up a character selection screen for a local multiplayer game. Try to think of a Gauntlet style game, where before gameplay, each player can flip through characters on the HUD and select one, once everyone has picked a character the game begins and you spawn as your selected character.
I have the UI setup to show the models and I can flip between them using mouse clicks on a specific button, but how can I let each individual player pick their hero? I don’t see a way to get a specific gamepads input. i.e. Gamepad 2 left and right Dpad. Is this something that could come in an update? It would be really helpful I imagine for local multiplayer games. I read about a c++ method that overrides a viewport functions, but I’m at a loss for doing this in blueprint.
Otherwise I’ll have to make a ton of extra HUD nodes, and do character selection one at a time, with the illusion that only one person can pick their character, which just isn’t going to cut it for what I’m working on. Perhaps I need to make a playerController BP for each player?
Well I just found a ‘Was Input Key Just Pressed’ which returns a boolean, and can take in a player controller with an index. So using some clever branching, and a ton of nodes, I can check to see if a certain player just pressed the button, whenever that button is pressed.
Neat trick man. Thanks a lot for sharing this little tip. I tried it with 2 gamepads and it worked like a charm.
I made a function out of this in my level BP, you connect it to a gamepad event, plug the key variable to the function argument, and it returns the associated player number!
WOW!! They really make it weird, don’t they. Thanks for sharing this. I still would need this to actually work upon “InputAction” and not raw keys. But it’s something.