Calling CreatePlayer (Blueprint) on client leads to bug
I would like to support combined local and remote multiplayer. If I call "CreatePlayer" on the client side (HasAuthority remote) this leaves a mess. It does create a new character, and yes, this character can be controlled using a gamepad on the client. But on the server side, suddenly the second gamepad also works and I can control a second character on the server (which is actually a client character). It seems like an additional "local" controller is also created on the server, which is a bug, because there is still only one local player on the server.
How to reproduce: Connect two gamepads. Use third person blueprint template, create some spawn points, map the character jump action to "has authority - remote" and then "CreatePlayer". Run the game in client/server mode with 2 players (in two windows).
Then select the client window and press the jump button (for the client). This creates an additional player.
Afterwards, you will be able to control 2 players both in the client window and in the server window, which is wrong. It should only be possible in the client window.
In order to phrase a proper question: How do I create an additional local player for correct use with remote multiplayer?
I've spent a lot of time to find a workaround for this issue. Basically, one could state that this is "working as designed" but the design is very bad imho.
The solution is, basically, the following: If you need to run CreatePlayer on a Client (which is connected to a server), simply do not use the return value. Instead, use some kind of player activation based on the local player id in BeginPlay of the Controller.
answered Jan 30 '17 at 08:48 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here