Not sure why none of these functions are working. I know it’s set to the correct GameMode under project settings because the game using code from the constructor successfully. I never see anything from these functions appear on the screen
ATypingRunGameMode::ATypingRunGameMode(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
// set default pawn class to Blueprinted character
static ConstructorHelpers::FClassFinder<APawn> PlayerPawnBPClass(TEXT("/Game/Blueprints/MyCharacter"));
if (PlayerPawnBPClass.Class != NULL)
{
DefaultPawnClass = PlayerPawnBPClass.Class;
}
//Set the default PlayerController class
PlayerControllerClass = ATypingRunPlayerController::StaticClass();
//Set the default HUD class
HUDClass = ATypingHUD::StaticClass();
PrimaryActorTick.bCanEverTick = true;
PrimaryActorTick.bStartWithTickEnabled = true;
}
void ATypingRunGameMode::Tick(float DeltaSeconds)
{
Super::Tick(DeltaSeconds);
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("Tick function"));
}
void ATypingRunGameMode::BeginPlay()
{
Super::BeginPlay();
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("Test"));
SetCurrentState(ETypingRunPlayState::EPlaying);
}
Any idea?