Here’s the code:
TestActor.h:
UCLASS()
class ATestActor : public AActor
{
GENERATED_UCLASS_BODY()
virtual void Tick(float DeltaTime) override;
};
TestActor.cpp:
ATestActor::ATestActor(const class FPostConstructInitializeProperties& PCIP)
: Super(PCIP)
{
PrimaryActorTick.bCanEverTick = true;
}
void ATestActor::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
if (GEngine)
{
GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Yellow, TEXT("Tick"));
}
}
The “Tick”-text is never displayed on the screen, which would mean that the Tick()-function never gets called. Why? I enabled bCanEverTick and it’s still not ticking…