Unable to create output log in UE4 C++ course

I’m currently on episode 91 of https://www.udemy.com/course/unrealcourse/ and despite two attempts, cannot generate a log output.
Copying and pasting from https://github.com/UnrealCourse2019/BuildingEscape/blob/bfcae70dcb38757f9e9f0f73983c769600689d0d/Building_Escape/Source/Building_Escape/WorldPosition.h creates red squiggy line under #include “WorldPosition.generated.h”

Please help.

Code is as follows:

#include “WorldPosition.h”

// Sets default values for this component’s properties

UWorldPosition::UWorldPosition()

{

// Set this component to be initialized when the game starts, and to be ticked every frame.  You can turn these features

// off to improve performance if you don't need them.

PrimaryComponentTick.bCanEverTick = true;

// ...

}

// Called when the game starts

void UWorldPosition::BeginPlay()

{

Super::BeginPlay();

UE_LOG(LogTemp, Display, TEXT("Just a log, nothing to see!"));

UE_LOG(LogTemp, Warning, TEXT("This is a Warning!"));

UE_LOG(LogTemp, Error, TEXT("ERROR!"));

}

// Called every frame

void UWorldPosition::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)

{

Super::TickComponent(DeltaTime, TickType, ThisTickFunction);

// ...

}

// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include “CoreMinimal.h”

#include “Components/ActorComponent.h”

#include “WorldPosition.generated.h”

UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )

class BUILDINGESCAPE_API UWorldPosition : public UActorComponent

{

GENERATED_BODY()

public:

// Sets default values for this component's properties

UWorldPosition();

protected:

// Called when the game starts

virtual void BeginPlay() override;

public:

// Called every frame

virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;

};

Googling by another route has solved the issue: https://answers.unrealengine.com/questions/740950/cannot-open-source-file-namegeneratedh.html

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms