I wanted to create a custom blueprint class based on TextRenderComponent but it wouldn’t allow it in the editor, so I:
- Created a new C++ class, inheriting from TextRenderComponent, called InheritableTextRenderComponent
- Added ‘Blueprintable’ to its UCLASS specifier
- Created a blueprint inheriting from InheritableTextRenderComponent
However the EventTick function in the blueprint class is never called. I’ve created a constructor in InheritableTextRenderComponent that should call its parent, which sets bCanEverTick. The EventBeginPlay event works fine in the blueprint class. Blueprint classes inheriting from scene components tick fine.
C++ code is below. Can anyone help with this?
InheritableTextRenderComponent.h:
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "Components/TextRenderComponent.h"
#include "InheritableTextRenderComponent.generated.h"
/**
*
*/
UCLASS(ClassGroup = Rendering, Blueprintable, BlueprintType, hidecategories = (Object, LOD, Physics, TextureStreaming, Activation, "Components|Activation", Collision), editinlinenew, meta = (BlueprintSpawnableComponent))
class TROPICALMANIPULATION_API UInheritableTextRenderComponent : public UTextRenderComponent
{
GENERATED_BODY()
UInheritableTextRenderComponent(const FObjectInitializer& ObjectInitializer);
};
InheritableTextRenderComponent.cpp:
// Fill out your copyright notice in the Description page of Project Settings.
#include "TropicalManipulation.h"
#include "InheritableTextRenderComponent.h"
UInheritableTextRenderComponent::UInheritableTextRenderComponent(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
}