# After addding custom controller player not being posssed

**URL:** <https://forums.unrealengine.com/t/after-addding-custom-controller-player-not-being-posssed/1145979>\
**Category:** Blueprint\
**Tags:** possess, unreal-engine, question\
**Created:** [April 27, 2023, 8:29am UTC](https://forums.unrealengine.com/t/after-addding-custom-controller-player-not-being-posssed/1145979 "2023-04-27T08:29:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![MR\_Censureret](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MR\_Censureret](https://forums.unrealengine.com/u/MR_Censureret)\
**Post date:** [April 27, 2023, 8:29am UTC](https://forums.unrealengine.com/t/after-addding-custom-controller-player-not-being-posssed/1145979/1 "2023-04-27T08:29:03Z")

</div>

After ive added my own implementation of the player controller my pawn is spawned into the world but not posssed.

I dont really know what to do :S

I can see in my editor that it spawns the player but also spawns the spectator class. This is my BP\_Playercontroller.cpp:

```auto

#include "Players/ABPlayerController.h"
#include "Players/ABPlayerState.h"
#include "UI/ABHUDWidget.h"
void AABPlayerController::CreateHUD()
{
	if (UIHUDWidget)
	{
		return;
	}

	if (!UIHUDWidgetClass)
	{
		UE_LOG(LogTemp, Error, TEXT("%s() Missing UIHUDWidgetClass. Please fill in on the Blueprint of the PlayerController."), *FString( __FUNCTION__ ));
		return;
	}

	// Only create a HUD for local player
	if (!IsLocalPlayerController())
	{
		return;
	}

	// Need a valid PlayerState to get attributes from
	AABPlayerState* PS = GetPlayerState<AABPlayerState>();
	if (!PS)
	{
		return;
	}

	UIHUDWidget = CreateWidget<UABHUDWidget>(this, UIHUDWidgetClass);
	UIHUDWidget->AddToViewport();

	// Set attributes
	UIHUDWidget->SetCurrentHealth(PS->GetHealth());
	UIHUDWidget->SetMaxHealth(PS->GetMaxHealth());
	UIHUDWidget->SetHealthPercentage(PS->GetHealth() / FMath::Max<float>(PS->GetMaxHealth(), 1.f));
}

UABHUDWidget* AABPlayerController::GetHUD()
{
	return UIHUDWidget;
}

void AABPlayerController::OnPossess(APawn* InPawn)
{
	AABPlayerState* PS = GetPlayerState<AABPlayerState>();
	if (PS)
	{
		// Init ASC with PS (Owner) and our new Pawn (AvatarActor)
		PS->GetAbilitySystemComponent()->InitAbilityActorInfo(PS, InPawn);
	}
}

void AABPlayerController::OnRep_PlayerState()
{
	Super::OnRep_PlayerState();

	// For edge cases where the PlayerState is repped before the Hero is possessed.
	CreateHUD();
}

```

My game mode and game state are blueprints that are mostly empty. The map i have only has a player start component (not the actual character).

Can anyone tell what ive might done wrong?
