I was following this tutorial for local coop and have encountered an issue regarding player movement.
Currently I have a BP_CharacterController file which is my default Player Controller Class inside my Game Mode.
This Controller sets up movement for my characters and looks like this
Spawning the characters with different gamepads/keyboard works fine.
However, I cant get my movement implementation inside my character controller to work properly.
What happens now is:
I Press enter to spawn my player 1 character
I press the start button on the gamepad to spawn player 2 character
Player 1 is being moved by Keyboard AND Gamepad while Player 2 is not being moved at all
I think this has something to do with me not setting up the target for my “Add Movement Input” node correctly.
If you want specifically that order (i.e. keyboard controls player 1 and gamepad controls player 2) you can use an option in the project settings just for that.
If you want it to be related to when an input presses the start button, then the problem could be related to the player controller, you may need to spawn a player controller as well as the pawn when you create it. Then possess the pawn using that player controller.
Thanks for your reply!
I already did that in the project settings. My problem was that even tho each character has been assigned a controller, the controllers were all controlling the same character no.1.
I managed to fix this problem this way:
By saying that the target is “Get controlled pawn”, each player character is being moved by its own controller(gamepad/keyboard).
Another solution I found for this was to simply add the movement controls inside the character blueprint itself with target being “self”. But since I’m using a PlayerController class/blueprint, I had to solve it this way