# Missing "RemovePlayer" node

**URL:** <https://forums.unrealengine.com/t/missing-removeplayer-node/306650>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [February 11, 2015, 12:46pm UTC](https://forums.unrealengine.com/t/missing-removeplayer-node/306650 "2015-02-11T12:46:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eduard\_Gotwig\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Eduard\_Gotwig\_1](https://forums.unrealengine.com/u/Eduard_Gotwig_1)\
**Post date:** [February 11, 2015, 12:46pm UTC](https://forums.unrealengine.com/t/missing-removeplayer-node/306650/1 "2015-02-11T12:46:10Z")

</div>

In C++, you are able to remove players via the gameInstance, but in Blueprint there is currently no node to do so.

Check the answer section of a proposed fix for this of me.

I hope to see this in Unreal Engine at some point.

Cheers.

---

<div class="post-metadata">

**Author:** ![Eduard\_Gotwig\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Eduard\_Gotwig\_1](https://forums.unrealengine.com/u/Eduard_Gotwig_1)\
**Post date:** [February 11, 2015, 12:49pm UTC](https://forums.unrealengine.com/t/missing-removeplayer-node/306650/2 "2015-02-11T12:49:18Z")

</div>

EDIT: As of now it seems to be not working… for now im going to use this deprecated (!) code instead: [How do I remove a second splitscreen player? - Blueprint - Epic Developer Community Forums](https://answers.unrealengine.com/questions/140342/how-do-i-remove-a-second-splitscreen-player.html)

Add a new Blueprint Function library, with the name “UBP\_FuncLib” and add this code for the cpp file :

```
#include "CarCarCar.h"
#include "UBP_FuncLib.h"
#include "Runtime/Engine/Classes/Engine/GameInstance.h"

void UUBP_FuncLib::RemoveSplitscreenPlayers()
{
	const int32 MaxSplitScreenPlayers = 4;
	ULocalPlayer* PlayersToRemove[MaxSplitScreenPlayers];
	int32 RemIndex = 0;

	for (FConstPlayerControllerIterator Iterator = GEngine->GameViewport->GetWorld()->GetPlayerControllerIterator(); Iterator; ++Iterator)
	{
		// Remove only local split screen players
		APlayerController* Controller = *Iterator;
		if (Controller && Controller->IsLocalController() && !Controller->IsPrimaryPlayer())
		{

			ULocalPlayer* ExPlayer = Cast<ULocalPlayer>(Controller->Player);
			if (ExPlayer)
			{
				PlayersToRemove[RemIndex++] = ExPlayer;
				Controller->PawnPendingDestroy(Controller->GetPawn());
			}
		}
	}

	UWorld* currentWorld = GEngine->GetWorld();
	UGameInstance* gameInstance = currentWorld->GetGameInstance();

	for (int32 i = 0; i < RemIndex; ++i)
	{
		gameInstance->RemoveLocalPlayer(PlayersToRemove[i]);
	}

}

```

For the .h file add this code:

```
#pragma once

#include "Kismet/BlueprintFunctionLibrary.h"
#include "UBP_FuncLib.generated.h"

/**
 * 
 */
UCLASS()
class CARCARCAR_API UUBP_FuncLib : public UBlueprintFunctionLibrary
{
	GENERATED_BODY()

public:
	UFUNCTION(BlueprintCallable, Category = "CustomLibrary")
	static void RemoveSplitscreenPlayers();	
};

```
