Is GEngine dead?

Im trying to print a string on the game. (Following the Hello World tutorial from Epic) But I don’t know what’s going wrong.

void AHelloWorld::BeginPlay()
	if (GEngine)
		GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Yellow, TEXT("Hello World!"));
		GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Yellow, FString::FromInt(Number));

When I build the solution it says that GEngine is not defined. Im building with “Development Editor” and using Win64.

Whops! Nevermind. I solved it.

Just added:

#include “Engine.h” in the .cpp file

Good to know :slight_smile:

I would rather include “Runtime/Engine/Classes/Engine/Engine.h” instead of the whole engine, because if you include the “Engine.h” it will take forever to build your code.

Thanks for the heads up about that! Just included Engine.h and almost died of boredom while it compiled. Good to know that there is a MUCH better way.