Bug: FPSProject Tutorial Documentation Out Of Date - User must include Engine.h to access GEngine

High Level: Tutorial provides sample C++ code. Code is now invalid due to ongoing work with engine.

LINK: FPSProjectGameMode

Specific:

  1. Tutorial does not instruct user to include Engine.h in the FPSProjectGameMode header file.

  2. Tutorial instructs user to access GEngine in FPSProjectGameMode.cpp

  3. GEngine is not accessible w/o header file. User cannot compile game.

Code for Header

 #pragma once
 #include "GameFramework/GameModeBase.h"
 #include "FPSGameMode.generated.h"
 
 UCLASS()
 class FPSPROJECT_API AFPSProjectGameMode : public AGameModeBase
 {
     GENERATED_BODY()
 
     virtual void StartPlay() override;
 };

Code for CPP file, StartPlay method

 void AFPSProjectGameMode::StartPlay()
 {
     Super::StartPlay();
 
     if (GEngine)
     {
         // Display a debug message for five seconds. 
         // The -1 "Key" value (first argument) indicates that we will never need to update or refresh this message.
         GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Yellow, TEXT("Hello World, this is FPSGameMode!"));
     }
 }

Hey loveLockheart-

Thank you for letting us know about the documentation page. I have entered a report (UEDOC-4327) to have the documentation page updated.

Cheers