TextRenderComponent.h is inaccessible

Using the official tutorial and a number of other variations of implementation UTextRenderComponent can be implemented, compiled and successfully executed using C++ but Visual Studio warns me that the functions of this component are inacessible, underlines them in red* and refuses to reveal the functions.

[*In the following example specifically the keywords “SetText” and “SetRenderColour” are underlined as being inaccessible]

This occurs regardless of includes, of which I am currently using the following in the .cpp

#include "Components/TextRenderComponent.h"
#include "Engine/TextRenderActor.h"
#include "Components/TextBlock.h"

This occurs regardless of forward declaration ‘class’ variations also.

void AGameop::BeginPlay()
{
	Super::BeginPlay();

	FVector Location(-5.0f, -43.0f, 130.0f);//  X / Y / Z
	FRotator Rotation(0.0f, 180.0f, 0.0f);  //  X / Z / Y
	FActorSpawnParameters SpawnInfo;
	SpawnInfo.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;
	TextDisplay = ()->SpawnActor<ATextRenderActor>(Location, Rotation, SpawnInfo);
	TextDisplay->GetTextRender()->SetText(_displayText);
	TextDisplay->GetTextRender()->SetTextRenderColor(FColor::Green);
	TextDisplay->SetActorScale3D(FVector(0.3f));
	TextDisplay->AttachToComponent(SceneComponent, FAttachmentTransformRules::KeepRelativeTransform);
	
}

As I say. The code works. You can update the text dynamically without issue also. It is simply that the compiler complains and wont show you the available functions.

In addition, possibly a separate issue, possibly related, the axes of rotation and location modify in a different order to that expected. The axes are as noted in the comments of the above code.

Although I’m tagging this as a bug report I could be completely wrong and could be implementing this wrongly somehow. I’m very experienced in C++ but still a beginner with UE4, so advice welcomed.

Hello,

We’ve recently made a switch to a new bug reporting method using a more structured form. Please visit the link below for more details and report the issue using the new Bug Submission Form. Feel free to continue to use this thread for community discussion around the issue.

https://epicsupport.force.com/unrealengine/s/

Thanks

That not compiler issue, thats InteliSense. Due to lot of trickery that UE4 uses in C++ and some custom tools, it’s frequently confuses InteliSense and shows non-existent errors, thats why it is better to relay on compiler output log the Errors tab. This issue exist since very beginning UE4 became public.

Lot of people recommends to use Visual Assist plugin, it supposedly works a lot better with UE4:

But i never used it myself so i don’t know how effective it is.

Since UBT only needs VS compiler and don’t interact with VS project you can use any text editor or IDE to code for UE4, so if you know better IDE you can try configure it for UE4. The compilation commands for UBT you can find in nmake section of VS project configuration and you can just call them anywhere to build the code, ofcorse you will still need VS installed for compiler.