In Lyra, input is received from multiple gamepads and, for the life of me, I can’t figure out how, been at it for 3 days now. To demonstrate this, if we override the ‘InputKey’ function inside the ViewportClient class:
bool ULyraGameViewportClient::InputKey(const FInputKeyEventArgs& EventArgs)
{
UE_LOG(LogTemp, Log, TEXT(“[ULyraGameViewportClient] ControllerId: %i, %s”), EventArgs.ControllerId, *EventArgs.Key.ToString());
return Super::InputKey(EventArgs);
}
the game will print ControllerId 0 and 1 depending on what gamepad we use. This is used beautifully in the main menu to add another player for split screen.
I know about the ‘CreatePlayer’ node. Lyra doesn’t use it. So how then do they get input from other gamepads? I am using the exact settings as Lyra… pls help.
Also,
In my experiments I actually managed to break this and now, If I have 2 gamepads connected, the second one is ignored but when I use the first one, it prints 2 times for every button press. I redownloaded the project, checked code and project config, all is identical, the new copy works, the old one does not, no idea how i broke it.
EDIT:
With console command ‘showdebug enhancedinput’ i can see that device 0 has a weird name… in the Lyra demo that works they are both (XinputInterface:XInputController)
No idea why or how, but it might be related to the issue.