Issue displaying position reports in the Output Log

I’ve triple checked my code and everything inside of the class file seems to be fine, the issue that I see displayed in the Unreal output log is as follows:

Other than this warning, I do not see any other warnings (including the position report warning)

Below is what my code inside of the PositionReport class looks like: (Specifically the only section we worked on)

// Called when the game starts
void UPositionReport::BeginPlay()
{
Super::BeginPlay();

// Defining Variable
FString ObjectName = GetOwner()->GetName();

UE_LOG(LogTemp, Warning, TEXT("Position report for %s"), *ObjectName);

}

Lastly, I see in the lesson video that Ben has “bWantsBeginPlay = true” inside of UPositionReport::UPositionReport()
If I try to add this to my code it does not compile. I’m just curious as to why it’s there.

How does it not compile in that case?

I believe the first warning is because you are referencing BuildingEscapeGameMode somewhere and it’s looking in that file path for it. For example in my BuildingEscapeGameMode.cpp I have

ABuildingEscapeGameMode::ABuildingEscapeGameMode() : Super()
{
	//set default pawn class to Blueprinted character
	static ConstructorHelpers::FClassFinder<APawn> PlayerPawnClassFinder(TEXT("/Game/Blueprints/BP_FirstPersonCharacter"));
	DefaultPawnClass = PlayerPawnClassFinder.Class;
}

The line static ConstructorHelpers::FClassFinder<APawn> PlayerPawnClassFinder(TEXT("/Game/Blueprints/BP_FirstPersonCharacter")); is referencing the FirstPersonCharacter I have in the Blueprints folder.

bWantsBeginPlay has been deprecated in the latest version of UE4 (4.14.x)

Though this is only a warning and shouldn’t stop you from successfully compiling, so it doesn’t compile then something else must be the problem or it did compile and you think it didn’t.

Sam everything compiles just fine. I just can’t get the output log to display the position report warning (As shown in the lesson video.) When I hit play in the unreal editor is does not display the warning output. That’s the issue I am having, sorry I did not clarify that from the beginning.

Hello Dan, thank you for the insight and help! My code compiled just fine though, the issue I was facing was getting the warning message for the log output to display the position report. The only warning message displayed was the one I showed above. Thanks again!

"If I try to add this to my code it does not compile. "
You stated that it didn’t if you added that line

Onto the actual problem, are you sure you have the position report component added to an object?

If you do, do you have your project on github or anything so I could take a look at it?

It didn’t compile if I inserted the line “bWantsBeginPlay = true”. That was meant to be a side question of it’s own.

I’ll double check after I finish eating dinner and get back to you about the position report.

I have everything working just as it should now. The issue was I did not add the component to each object. I only created it and somehow missed the part where I needed to add it to every object. Thanks for all your help, I appreciate your patience.

Privacy & Terms