AGameModeBase::StartPlay not running

AGameModeBase::StartPlay not running

I make a few following steps, but my ARoomEscapeGameModeBase::StartPlay did not working

Steps:

  1. create new GameMode GameModeBase C++ class ( ARoomEscapeGameModeBase : public AGameModeBase )
  2. select in Edit>Project settings>Maps&Modes default GameMode = “ARoomEscapeGameModeBase”
  3. select in World settings “ARoomEscapeGameModeBase”
  4. Write some code

But after starting game, i see nothing in my LOG

ARoomEscapeGameModeBase.h

// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "GameFramework/GameModeBase.h"
#include "RoomEscapeGameModeBase.generated.h"

/**
 * 
 */
UCLASS()
class ROOMESCAPE_API ARoomEscapeGameModeBase : public AGameModeBase
{
	GENERATED_BODY()

public:
    virtual void StartPlay() override;
	
};

ARoomEscapeGameModeBase.cpp

// Fill out your copyright notice in the Description page of Project Settings.

#include "RoomEscapeGameModeBase.h"

void ARoomEscapeGameModeBase::StartPlay()  {
    
    Super::StartPlay();
    
    UE_LOG( LogTemp, Warning, TEXT("Initializing game in GameMode in C++") );
    
    UE_LOG(LogTemp, Warning, TEXT("Your message"));

}

Please tell me why I do not see anything in my LOG ?

BEN, eto ,
i need help ))

The function is called BeginPlay, not StartPlay

There is actually StartPlay, if it was not he would have compilation errors from invalid override

BeginPlay is inherited from AActor.
StartPlay is inherited from AGameMode.

Try going into world settings and setting the GameMode Override to your ARoomEscapeGameModeBase.

Tested with your code, not binding that GameMode to the override in World Settings I did not see the log in StartPlay.

Oh, I had no idea about that.