Following UE4 Cookbook Tutorial - and whatever I do, - can’t get my Log message out. (On screen or Log Output).
MyProjectGameModeBase.cpp
// Copyright Epic Games, Inc. All Rights Reserved.
#include "MyProjectGameModeBase.h"
void AMyProjectGameModeBase::BeginPlay()
{
Super::BeginPlay();
UE_LOG(LogTemp, Warning, TEXT("Warning Message...........") );
}
MyProjectGameModeBase.h
// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/GameModeBase.h"
#include "MyProjectGameModeBase.generated.h"
UCLASS()
class MYPROJECT_API AMyProjectGameModeBase : public AGameModeBase
{
GENERATED_BODY()
public:
void BeginPlay();
};
I think the problem is that you are not using the Game Mode Base, where the UE_LOG is located.
You can solve this problem by going to you Project Settings (Edit → Project Settings) and selecting Maps & Modes. Here you can see the Default GameMode. Change that to be the MyProjectGameModeBase that you coded and press Play.
I also noticed that in your Header File when you are declaring your BeginPlay() function, you are not declaring it as virtual so instead of overriding the Super::BeginPlay(), it hides it. Try declaring it like so:
virtual void BeginPlay() override;
Edit: I also recommend you declaring it under a protected section.
This worked for me even though I’m using VS Community 2022. Also, I have UE5.3.2 installed, and my Show All was already checked under Output Log Filters.