How to spawn my DefaultPawn character until function RestartPlayer is called

I’m learning official example ARPG, and I met one trouble. I set my BP_PlayerCharacter as Default Pawn class and its playercontroller in my gamemode. And when click play in the editor, the PlayerCharacter will spawn and possessby PlayerController at once, this happened before BeginPlay called in GameMode. However, in official example, character will spawn and possessby PlayerController until RestartPlayer function called in BP.
Do I miss any setting? Auto Possess is disabled in Player Character. Really hope someone can help me.

Hmm, a bit hard to understand your question - im just going to take a stab at giving an idea here.

My best guess to your question is, you are Not wanting to spawn a player when you hit play to start PIE, is that correct? Basically, I think you will need to hop into (or create new) GameMode Blueprint. In the default ThirdPersonGameMode there is a bool you can enable to have players spawn as a spectator on initialization.

Hopefully i’m not too far off track here, but maybe this will at least point you in the right direction if nothing else…

Thanks for you reply. Yeah, I’m not wanting to spawn a player when hit play to start PIE. In Game :

271429-arpg.png

Its GameMode setting:

271452-gamemodesettings.png

In my project, the event in BeginPossessPawn happened amost at once I click play to start PIE. However , In official project, this happen when RestartPlayer is called. I want to figure out why.

271430-playercontrollerevent.png

RestartPlayer function:

271453-restartplayer.png

Sorry for the poor layout, the layout turn out not the same as I expected. And thanks your reply again. it offer me another way to make a implementation. And it would be better if you can help me figure out this.

I find the reason why ARPG will not spawn player at once.
In BP_GameMode, it override the PlayerCanRestart function.
void AGameModeBase::HandleStartingNewPlayer_Implementation(APlayerController* NewPlayer)
{
// If players should start as spectators, leave them in the spectator state
if (!bStartPlayersAsSpectators && !MustSpectate(NewPlayer) && PlayerCanRestart(NewPlayer))
{
// Otherwise spawn their pawn immediately
RestartPlayer(NewPlayer);
}
}