Reproduction is simple. Create a new C++ class, inherit it from USceneComponent, add there a UTextRenderComponent.
// h
#pragma once
#include "CoreMinimal.h"
#include "Components/PrimitiveComponent.h"
#include "Components/TextRenderComponent.h"
#include "ExamplePrimitiveComponent.generated.h"
// USceneComponent as parent is not working as well
UCLASS(Blueprintable)
class PROJECT_API UExamplePrimitiveComponent : public UPrimitiveComponent
{
GENERATED_BODY()
public:
UExamplePrimitiveComponent();
// Removing UPROPERTY does not help
UPROPERTY(EditAnywhere, BlueprintReadWrite)
TextRenderComponent * Text;
};
// cpp
#include "ExamplePrimitiveComponent.h"
#include "Components/PrimitiveComponent.h"
UExamplePrimitiveComponent::UExamplePrimitiveComponent()
{
Text = CreateDefaultSubobject<UTextRenderComponent>( TEXT("Rendered Text") );
Text->SetupAttachment(this);
// Not working too
//Text->AttachToComponent(this, FAttachmentTransformRules::KeepRelativeTransform);
//Text->RegisterComponent();
Text->SetVisibility(true);
}
Compile, run, create a blueprint class based on this.
Adjust e.g. color of text.
Create actor bp, add this component
Gizmo has no effect on ExamplePrimitiveComponent
I haven’t found any workarounds so far.
Worth mentioning that using that component without blueprinting works fine