UActorComponent not Ticking

Hello,

I have a custom class which inherits UActorComponent. I’ve set…

PrimaryComponentTick.TickGroup = TG_PrePhysics;
PrimaryComponentTick.bCanEverTick = true;
bAutoActivate = true;
SetComponentTickEnabled(true);

And in the header file

virtual void TickComponent(float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction *ThisTickFunction);

But TickComponent is never called?

I tried

RegisterComponentTickFunctions(true);

But then it crashes on BeginPlay() of the parent actor?

Unknown exception - code 00000001 (first/second chance not available)

Assertion failed: GTestRegisterComponentTickFunctions == NULL [File:D:\BuildFarm\buildmachine_++depot+UE4-Releases+4.6\Engine\Source\Runtime\Engine\Private\ActorComponent.cpp] [Line: 544]

I’ve fixed it! Not sure if this is the correct way of doing it.But I added

MyComponent->RegisterComponent();

After I create it.

I had problem with ticking component too… i just deleted and added new in BP and now everything works… some kind of bug (before i turned off tick in cpp and when i turned it on again, it doesnt worked)

i have this same bug with scene component and actor component sometime tick doesnt work

i have to delete them and add them again in BP to fix it

yes - I have the same problem in bp. delete the component, add it again and it ticks - someone should open a bug report to epic? it’s 4.17

Just in case anyone else runs across this post, my problems solution to similar symptoms was simply that I had overridden the BeginPlay() function and not called the Super::BeginPlay() inside it. This causes havoc with your components setup.

I was also hung up on this problem for a bit. Turns out I forgot to add the Super::Tick(DeltaTime); to the child classes tick function. But after adding the super, the actor was still not ticking. Turns out I was missing the super from begin play as well. I feel silly. Thank you for this! haha

I forgot to call Super::StartPlay() on my AMyGameModeBase,
and TickComponent is never called on AMyGameModeBase’s component .