YOU’RE A LEGEND! I forgot the Super::BeginPlay()
Wasted an hour not seeing the obvious… Thank you for this!
In my case the actor didn’t tick because I didn’t have any components. Adding this to the constructor fixed the problem:
RootComponent = CreateDefaultSubobject<USceneComponent>(TEXT("RootSceneComponent"));
Thanks for this thread, I had the same issue due to not calling Super::BeginPlay(), and the sneaky thing that took me a while to find after adding it to my subclasses was that I also hadn’t added it to their common base class.
In my case the reason was that i spawned AActor
via NewObject
:
NewObject<AMyUnit>(World);
while it have to be done via SpawnActor
:
World->SpawnActor<AMyUnit>();
I know that this is older post, but for me the following work. My class is child of the UActor
AUMyClass::AUMyClass() {
PrimaryActorTick.bCanEverTick = true;
}
void AUMyClass::BeginPlay() {
Super::BeginPlay();
}
void AUMyClass::Tick(float DeltaTime) {
Super::Tick(DeltaTime);
}
Setting the
PrimaryActorTick.bCanEverTick = true;
In the BeginPlay
instead of the constructor was problem.