I’ve replaced some C++ code with blueprints and gathered a simplified version of the logic in GameMode. I’m still having the same issue, but at least it is easier to show what I’m doing.
So, an Unreal V5.5.1 project. I’m creating a second player player in the level blueprint BeginPlay (so that I get two local players in split screen). Then, in GameMode BeginPlay I do the following:
This is my Spawn Pawn function:
…and finally, add InputContext:
I’d expect keyboard controls for first pawn, gamepad for second. But both keyboard and gamepad controls the first pawn.
However, if I switch the logic around so that the first player should get the gamepad and the second player keyboard controls, no pawn is controlled.
If I don’t create a second player, the single pawn is controlled by whichever of the two mapping contexts I add, as expected.
Any tips, suggestions or follow-up questions would be most welcome. I’m all out of ideas!