Where did AddPlayerStart & RemovePlayerStart go?

Hey all,

Before 4.9 I was using 4.7 and the following functions existed in 4.7 whereas now they do not: AddPlayerStart & RemovePlayerStart in the GameMode class. Where did these go? I kinda needed them to add more playerstarts for my level editor :slight_smile: Have these functions been replaced?

Cheers,
Jon

They indeed been removed, my guess is looking on them:

void AGameMode::AddPlayerStart(APlayerStart* NewPlayerStart)
{
	PlayerStarts.AddUnique(NewPlayerStart);
}

void AGameMode::RemovePlayerStart(APlayerStart* RemovedPlayerStart)
{
	PlayerStarts.Remove(RemovedPlayerStart);
}

Epic though you could simply interact with PlayerStarts array insted

It seems those functions got removed in 4.8 without warning

Unfortunately the PlayerStarts array also doesnโ€™t exist in 4.9! :frowning:

Oh is see, i review source code again and it seems it complitly remove use of that array (thats why those functions been removed. Insted engine searches for PlayerStart on the fly with iterators.

Looks like you will need to transform your code a little. The default spawn system calls FindPlayerStart and that calls ChoosePlayerStart before spawning to get best player start for specific PlayerController

https://github.com/EpicGames/UnrealEngine/blob/4.9/Engine/Source/Runtime/Engine/Private/GameMode.cpp#L354

https://github.com/EpicGames/UnrealEngine/blob/4.9/Engine/Source/Runtime/Engine/Private/GameMode.cpp#L1433

So implement your own array and override one of those functions to make it use that array., Note because they implmented function overrides in blueprints, you need to use *_Implementation in function name

Ah brilliant. Thanks for your help ! :slight_smile: