When is it appropriate to set the default pawn?

I’m trying to set the default pawn based on whether or not a VR headset is connected and enabled. Initially, I tried the following code in my game mode constructor:


if(UHeadMountedDisplayFunctionLibrary::IsHeadMountedDisplayConnected() && UHeadMountedDisplayFunctionLibrary::IsHeadMountedDisplayEnabled())
    {
        UE_LOG(LogTemp, Display, TEXT("VR Enabled"));
    }
    else
    {
        UE_LOG(LogTemp, Display, TEXT("VR Disabled"));
    }

… This crashes the UE4Editor, probably because it is called too early? The goal is to set the default pawn before one is spawned, but after sufficient initialization is performed to not crash things… where’s a better spot for this?