x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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 = GetWorld()->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.

Product Version: UE 4.20
Tags:
more ▼

asked Nov 29 '18 at 05:34 PM in Bug Reports

avatar image

Rakaeon
1 1

avatar image Jeff A ♦♦ STAFF Nov 29 '18 at 09:46 PM

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

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

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:

https://www.wholetomato.com/

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.

more ▼

answered Nov 30 '18 at 01:04 AM

avatar image

Shadowriver
33.9k 916 164 1093

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question