Custom game mode makes unreal crash

Im trying to follow [this][1] tutorial to learn more about UE4, but my UE is crashing after hit play within the custom game mode.


#pragma once

#include "GameFramework/GameMode.h"
#include "FPSGameMode.generated.h"

class AFPSGameMode : public AGameMode

	virtual void BeginPlay() override; // The 4.3 version changed this method to StartPlay()


#include "TEST.h"
#include "FPSGameMode.h"

AFPSGameMode::AFPSGameMode(const class FPostConstructInitializeProperties& PCIP)
	: Super(PCIP)


void AFPSGameMode::BeginPlay()


	if (GEngine)
		GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Yellow, TEXT("HELLO WORLD"));

This is how my project looks like:

Followed by the editors closure, This is what happens after I hit play:

And this is the error log output:

PIE: No blueprints needed recompiling
[2014.11.10-13.39.48:105][146]PIE: New page: PIE session: FPSMap
(10.11.2014 07:39:48)
PIE: StaticDuplicateObject took:
PIE: World Init took: (0.000588s)
PIE: Created PIE world by copying
editor world from
/Game/Maps/FPSMap.FPSMap to
[2014.11.10-13.39.48:110][146]LogWorld: Game class is ‘FPSGameMode’
The thread 0x206c has exited with code 0 (0x0).
The thread 0x2494 has exited with code 0 (0x0).
[2014.11.10-13.39.48:155][146]LogWorld: Bringing World
/Game/Maps/UEDPIE_0_FPSMap.FPSMap up
for play (max tick rate 0) at
[2014.11.10-13.39.48:156][146]LogWorld: Bringing up level for play took:
[2014.11.10-13.39.48:157][146]LogGameMode: RestartPlayer 256
[2014.11.10-13.39.48:157][146]LogPlayerController: ClientRestart_Implementation
[2014.11.10-13.39.48:158][146]LogPlayerController: ServerAcknowledgePossession_Implementation
First-chance exception at 0x000007F808306835
(PhysX3PROFILE_x64.dll) in
UE4Editor.exe: 0xC00000FD: Stack
overflow (parameters:
Unhandled exception at 0x000007F808306835
(PhysX3PROFILE_x64.dll) in
UE4Editor.exe: 0xC00000FD: Stack
overflow (parameters:

First-chance exception at 0x000007F808306835

(PhysX3PROFILE_x64.dll) in
UE4Editor.exe: 0xC0000005: Access
violation writing location
Unhandled exception at 0x000007F8

Version 4.1:


Since I’m not a lot experienced with Unreal, I have no clue what could possibly be causing this problem since the first steps of the tutorial are simple so far; Does anyone know what I’m missing?

Well, if you are on an engine version >= 4.3 then I think it may have something to do with the function you are overriding.

The tutorial you are following is overriding BeginPlay, but this doesn’t exist anymore in the current engine version, it is now called StartPlay. You can even see a comment they left in the tutorial code showing that it has been renamed.

I would recommend changing all of the instances of BeginPlay to StartPlay in your .h and .cpp files. This will hopefully get you going.

Like I said, mine it’s 4.1; If I change it to StartPlay(); its syntax is not recognized =/ check the version picture I’ve edited above

Updated to version 4.4, game mode is now running without problems - It must have been a bug from 4.1