RemovePlayer not working on client

(source build 4.11.0)

Blueprint node RemovePlayer works on server but not on client.

To reproduce the problem:

  • create project from blueprint ThirdPerson template
  • open level blueprint and add this:

  • set “Number of players” to 2 and launch play in editor
  • client screen gets split when CreatePlayer is executed, but the player is not removed and the screen stays split when RemovePlayer is executed

The result is the same even if Destroy Pawn is unchecked. The code works correctly if executed on the server (i.e. at the end the added player is removed and the screen is no more split). Delays are just to see the effects of single nodes, removing them the result is the same.

Hello matfer,

I was able to reproduce this issue on our end using the setup shown above. However, the issue appears to be with the return value of the create player node. I have written up a report ( UE-29832) and I have submitted to the developers for further consideration. I will provide updates with any pertinent information as it becomes available. Thank you for you time and information.

Example of workaround:

In this workaround I provide the player controller at index 1 (meaning the second player added) to the removed player manually. I hope that this information helps.

88000-removeplayerhelp.png

Make it a great day

Thank you for your answer. I tried the workaround exacly as you described and it worked, but I ran into other two issues:

1 - The code of your workaround did not work on the server, but it worked after I put 2 as player index in GetPlayerController, so it seems that the newly created player takes index 2. Maybe this is not exacly an issue, but I wonder why this happens.

2 - Using your code on the client, re-running CreatePlayer after running RemovePlayer crashes the editor with this message:

Fatal error:
[File:E:\UE4\UnrealEngine\Engine\Source\Runtime\Engine\Private\NetConnection.cpp]
[Line: 1712] Failed to find
LocalPlayer for received
PlayerController

To avoid misunderstandings, this is the code:

88057-create_player_crash.png

To reproduce run pie and in the client press F and then G.

Hello matfer,

I will need you to create a new thread for the crash that you are reporting for tracking purposes because it is a separate issue. After creating a new thread please feel free to post a link in the reply here and I will be happy to assist you further.