[UE 4.5 C++] Actor bug

I have huge problem with 4.5 version of Unreal Engine. First I will write steps how to reproduce it.

I am creating new project base on First Person C++ template in version 4.4 and 4.5 . In editor I am adding by “Add code to Project” new Actor class “MyTestActor”.
C++ is simple as this:

#pragma once

#include "GameFramework/Actor.h"
#include "MyActorTest.generated.h"

class ACTORTESTPRJ_API AMyActorTest : public AActor

	bool bFail = false;

	virtual void BeginPlay();
	virtual void OnConstruction(const FTransform& Transform);


#include "TestActorPrj.h"
#include "MyActorTest.h"

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


void AMyActorTest::OnConstruction(const FTransform& Transform)
	bFail = true;
	UE_LOG(LogTemp, Warning, TEXT("Name: %s ,%d"), *this->GetName(), bFail);

void AMyActorTest::BeginPlay()
	UE_LOG(LogTemp, Warning, TEXT("Name: %s ,%d"), *this->GetName(), bFail);

After launching Editor I am adding MyTestActor on the scene. Click ‘Save’, closing Editor (for proper logging), running my project again from VS and hitting Play

Now the difference between 4.4 and 4.5


  • OnConstruction is called twice
  • my bFail boolean = true


  • OnConstruction is called three times
  • my bFail bool = false

Why my bool has been ‘reset’ to default value ? It does not make sens and this is the simplest example with what I have problem. Any ideas ?

Are you sure you only have one actor in the scene?

Yes. You can check it out by reproducing my steps above

Hello kamesenin,

I’m marking this question as Resolved because it’s been answered in your other thread.