Local MP: Second player created; how to control it?
Hello. I've set the level blueprint to create a second player a few seconds after game starts (so the first player can move away from Player Start, just a rudimentary temporary solution).
The issue is that the second player doesn't respond to user input, I have a X360 gamepad connected to the computer and, opposed to what I've read in an older thread, the gamepad doesn't automatically take control over the second player; the X360 gamepad just controls the first player, and the same for keyboard and mouse.
I've checked through a "Print String" function that Player Index 1 and PlayerController 1 do exist; another prove is that, in the graph section showed below (level blueprint), the second player part of the split screen effectively is set to a camera (and that requires PlayerController 1 to exist as you can see).
So what can I do to make the gamepad take control over the second player?
asked Apr 12 '14 at 09:20 AM in Blueprint Scripting
I've finally done it with a C++ function in my GameMode subclass that calls this:
Thanks to slayeruk for pointing it.
Both player are only controllable with two X360 gamepads in my case though. And at first the second player doesn't spawn because the first one is blocking the Player Start; a timer call in the C++ code or a more complex spawning system can be used to solve that.
The first gamepad, the keyboard and the mouse seem to have the same internal controller id, which is 0. So you cannot easily control the first player with the mouse and the second using the first controller.
Creating a user via blueprints is done using "CreatePlayer" which can also simply be called in C++ with UGameplayStatics::CreatePlayer().
answered Oct 23 '14 at 01:01 PM
I answered this question here.Hope it works for u . https://answers.unrealengine.com/questions/296466/character-not-moving-and-game-spawns-two-character.html#answer-572391
answered Mar 07 '17 at 03:53 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here