I’m experiencing a weired error when trying to make my actor tick.
This is what my constructor looks like:
AProceduralStreetActor::AProceduralStreetActor(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
{
SetActorTickEnabled(true);
PrimaryActorTick.bCanEverTick = true;
PrimaryActorTick.SetTickFunctionEnable(true);
PrimaryActorTick.bStartWithTickEnabled = true;
mesh = ObjectInitializer.CreateDefaultSubobject<UProceduralMeshComponent>(this, TEXT("Procedural Street"));
RootComponent = mesh;
}
Then I implemented the tick function:
void AProceduralStreetActor::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
UE_LOG(LogTemp, Warning, TEXT("ASD"));
DrawDebugPoint(GetWorld(), this->endLeftVertex, 20, FColor(255, 0, 0), false, 10.0f);
DrawDebugPoint(GetWorld(), this->endRightVertex, 20, FColor(128, 0, 0), false, 10.0f);
DrawDebugPoint(GetWorld(), this->startLeftVertex, 20, FColor(0, 255, 0), false, 10.0f);
DrawDebugPoint(GetWorld(), this->startRightVertex, 20, FColor(0, 128, 0), false, 10.0f);
DrawDebugPoint(GetWorld(), this->endLeftVertex + 0.5f * (this->endRightVertex - this->endLeftVertex), 20, FColor(0, 0, 255), false, 10.0f);
DrawDebugPoint(GetWorld(), this->startLeftVertex + 0.5f * (this->startRightVertex - this->startLeftVertex), 20, FColor(0, 0, 128), false, 10.0f);
}
… and added the definition to the header file:
virtual void Tick(float DeltaTime) override;
Nevertheless, the function is never called. What am I doing wrong?