Hi,
Currently I am using default player controllers. I posses every controller to a pawn, it’s working. The problem is that the first controller is always controlling keyboard and gamepad. I want to change that by creating my own controller class that inherits from PlayerController.
But how does that binding between Pawn and PlayerController works in detail? Like what happens in detail if a keyboard key was pressed? And why is only the pawn with Controller0 is getting keyboard input?
I assumed that the controller had a reference to the possessed pawn, but in the blueprints I cannot find anything like “GetPossessedPawn” or something…
For a possible solution I was thinking about following idea (see image). The controller (must be the first controller) is getting Keyboard/Gamepad0 input. If the input is from the keyboard, the command gets delegated to the “keyboard” pawn. If its not from the keyboard, the possessed pawn is getting that command.
This idea has some problems:
- There is no “GetPossessedPawn” function.
- This must be done for every InputAction. No generic way…
- The difference between Pressed and Released must be handled
Any idea for a solution without the 3 problems?