UFUNCTION methods are not being called from blueprints that extend from a C++ Actors that make use of TimeLineComponent if the it’s recofigured.
The C++ has the changes refreshed but not the Blueprint.
Here’s an example project:
Steps to reproduce:
STEP 1 - CONFIGURE THE TIMELINE
TimelineComponent = CreateDefaultSubobject<UTimelineComponent>(TEXT("TimelineComponent"));
TimelineComponent->SetLooping(false);
static ConstructorHelpers::FObjectFinder<UCurveFloat> CurveFloatRef(TEXT("CurveFloat'/Game/Test/CF_Test.CF_Test'"));
FOnTimelineFloat OnLTestTimelineFloat;
OnLTestTimelineFloat.BindUFunction(this, "UpdateValue");
TimelineComponent->AddInterpFloat(CurveFloatRef.Object, OnLTestTimelineFloat, "CurveFloat");
…
void ATestActor::UpdateValue(float ValueFromTimeline)
{
UE_LOG(LogTemp, Warning, TEXT(“ATestActor::UpdateValue() Value: %f CounterTest: %i”), ValueFromTimeline, ++CounterTest);
}
STEP 2 - RENAME BOUND METHOD AND RECONFIGURE
ATestActor::ATestActor() :Super()
{
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
TimelineComponent = CreateDefaultSubobject<UTimelineComponent>(TEXT("TimelineComponent"));
TimelineComponent->SetLooping(false);
static ConstructorHelpers::FObjectFinder<UCurveFloat> CurveFloatRef(TEXT("CurveFloat'/Game/Test/CF_Test.CF_Test'"));
FOnTimelineFloat OnLTestTimelineFloat;
OnLTestTimelineFloat.BindUFunction(this, "UpdateValueNew");
TimelineComponent->AddInterpFloat(CurveFloatRef.Object, OnLTestTimelineFloat, "CurveFloat");
}
void ATestActor::UpdateValueNew(float ValueFromTimeline)
{
UE_LOG(LogTemp, Warning, TEXT("ATestActor::UpdateValue() Value: %f CounterTest: %i"), ValueFromTimeline, ++CounterTest);
}