Fstring is undefined, apologies i know this is probably going to be simple fix

Fstring ObjectName = GetOwner()->GetName();

Fstring is undefined.

From previous lessons in the course i understand you have to use: (forum doesnt allow arrows around iostream but i know it needs them)

#include iostream
using Fstring = std::string;

But this still throws up an error.

Anyone have any ideas?
This is my current code as im just trying to finish off this lesson “Accessing Object Names”.

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

#include “PositionReporter.h”
#include “Gameframework/Actor.h”

// Sets default values for this component’s properties
UPositionReporter::UPositionReporter()
{
// 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 UPositionReporter::BeginPlay()
{
Super::BeginPlay();
Fstring ObjectName = GetOwner()->GetName();
UE_LOG(LogTemp, Warning, TEXT(“Position Report reporting for duty on chair”));

}

// Called every frame
void UPositionReporter::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* >ThisTickFunction)
{
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);

// …
}

EDIT: I’m absolutely dumb as hell, the issue was Fstring needed to be FString

Your FString, is missing a capitalization, and is Fstring, capitalize the ‘S’ and should be good to go!

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

Privacy & Terms