# CreatePlayer after RemovePlayer crashes the editor

**URL:** <https://forums.unrealengine.com/t/createplayer-after-removeplayer-crashes-the-editor/355546>\
**Category:** Getting Started & Setup\
**Tags:** playercontroller, unreal-engine, crash, question, Blueprint\
**Created:** [April 26, 2016, 2:54pm UTC](https://forums.unrealengine.com/t/createplayer-after-removeplayer-crashes-the-editor/355546 "2016-04-26T14:54:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![matfer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@matfer](https://forums.unrealengine.com/u/matfer)\
**Post date:** [April 26, 2016, 2:54pm UTC](https://forums.unrealengine.com/t/createplayer-after-removeplayer-crashes-the-editor/355546/1 "2016-04-26T14:54:57Z")

</div>

(source build 4.11.0)

Creating this thread to report a new problem as requested in [RemovePlayer not working on client - Blueprint - Unreal Engine Forums](https://answers.unrealengine.com/questions/409292/removeplayer-not-working-on-client.html)

I tried the workaround described in the thread above 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](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/0/c/e0c71db333f65fc686dfde21a77cdf7870232b03.png)

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

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e729f54e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e729f54e](https://forums.unrealengine.com/u/anonymous_user_e729f54e)\
**Post date:** [April 26, 2016, 9:21pm UTC](https://forums.unrealengine.com/t/createplayer-after-removeplayer-crashes-the-editor/355546/2 "2016-04-26T21:21:42Z")

</div>

Hello matfer,

I was able to reproduce this issue on our end. I have written up a report ( UE-29969) 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 your time and information.

Make it a great day

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_1e2504da](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_1e2504da](https://forums.unrealengine.com/u/anonymous_user_1e2504da)\
**Post date:** [May 16, 2020, 3:37am UTC](https://forums.unrealengine.com/t/createplayer-after-removeplayer-crashes-the-editor/355546/3 "2020-05-16T03:37:51Z")

</div>

I am also having this issue on UE 4.23 - was this looked into? Is there any current workaround?

This is the output I’m getting:  
LogNet: Error: Failed to find LocalPlayer for received PlayerController ‘PlayerControllerVRJPG\_C\_3’ with index 3. PlayerControllers:  
LogNet: - PlayerControllerVRJPG\_C /Game/Maps/UEDPIE\_3\_Default.Default:PersistentLevel.PlayerControllerVRJPG\_C\_0  
LogNet: - PlayerControllerVRJPG\_C /Game/Maps/UEDPIE\_3\_Default.Default:PersistentLevel.PlayerControllerVRJPG\_C\_1  
LogNet: - PlayerControllerVRJPG\_C /Game/Maps/UEDPIE\_3\_Default.Default:PersistentLevel.PlayerControllerVRJPG\_C\_2  
LogNet: - PlayerControllerVRJPG\_C /Game/Maps/UEDPIE\_3\_Default.Default:PersistentLevel.PlayerControllerVRJPG\_C\_3  
LogNet: UNetConnection::Close: [UNetConnection] RemoteAddr: 127.0.0.1:17777, Name: IpConnection\_25, Driver: GameNetDriver IpNetDriver\_20, IsServer: NO, PC: PlayerControllerVRJPG\_C\_0, Owner: PlayerControllerVRJPG\_C\_0, UniqueId: NULL, Channels: 84, Time: 2020.05.16-03.35.34  
LogNet: UChannel::Close: Sending CloseBunch. ChIndex == 0. Name: [UChannel] ChIndex: 0, Closing: 0 [UNetConnection] RemoteAddr: 127.0.0.1:17777, Name: IpConnection\_25, Driver: GameNetDriver IpNetDriver\_20, IsServer: NO, PC: PlayerControllerVRJPG\_C\_0, Owner: PlayerControllerVRJPG\_C\_0, UniqueId: NULL  
LogNet: Error: UEngine::BroadcastNetworkFailure: FailureType = ConnectionLost, ErrorString = Your connection to the host has been lost., Driver = GameNetDriver IpNetDriver\_20  
LogNet: Warning: Network Failure: GameNetDriver[ConnectionLost]: Your connection to the host has been lost.  
LogNet: NetworkFailure: ConnectionLost, Error: ‘Your connection to the host has been lost.’
