Hi, I am trying to give a way for my players to join the lobby in a local multiplayer game (non splitscreen) with the press of a button. The end goal is to have a menu like smash bros (for example). However I cannot find a way to do that.
Should I create player controllers for each player, and then simply let them be spectators if they didn’t join ? If so what should I do ?
My initial goal was to only create ULocalPlayer for players who wanna join. I have a way of detecting button pressed for unassigned controllers (through the UEnhancedInputWorldSubsystem), but I cannot find the controller id that pressed the button.
If you have a solution I would appreciate it.
Thanks a lot
So I found a workaround that is kinda ugly and invasive (in my opinion) but it works :
You should create a custom engine subsystem, who’s single purpose is to send an event on key press (you can add this feature on any subsystem really, in my case I didn’t have one so I created it). This event is fired when an input preprocessor receives a key down.
Relevant engine files :
Engine\Source\Runtime\Engine\Classes\GameFramework\InputDeviceSubsystem.h
Engine\Source\Runtime\Engine\Private\GameFramework\InputDeviceSubsystem.cpp
Engine\Source\Runtime\Slate\Public\Framework\Application\IInputProcessor.h