UActorComponent::TickComponent(...) not ticking for some reason.

I had the same problem. No Component Ticking. I solved it with this code in Actor’s Constructor:

PlayerStateComponent = CreateDefaultSubobject<UPlayerStateComponent>(TEXT("PlayerStateComponent"));
PlayerStateComponent->SetMobility(EComponentMobility::Movable);  // In case if you add it to a ACharacter/APawn
PlayerStateComponent->SetupAttachment(RootComponent);
PlayerStateComponent->RegisterComponent();
PlayerStateComponent->PrimaryComponentTick.bCanEverTick = true;

It has worked out after restarting an editor.

1 Like

I ran to the same issue in UE5.4, where the component tick doesn’t work even though it was enabled both at the component and parent’s constructors.

I found an easier solution by adding the following line in the parent/owner’s BeginPlay() or PostInitializeComponents() function override:


MyComponent->PrimaryComponentTick.bCanEverTick = true;

So my code in the character’s CPP file:

void AMyCharacter::PostInitializeComponents()
{
 Super::PostInitializeComponents();

MyComponent->PrimaryComponentTick.bCanEverTick = true;

}

The subcomponent inherited from UActorComponent will be created using UActorComponent constructor. But UActorComponent constructor is like this

UActorComponent::UActorComponent(const FObjectInitializer& ObjectInitializer /*= FObjectInitializer::Get()*/)
	: Super(ObjectInitializer)
{
	OwnerPrivate = GetTypedOuter<AActor>();

	PrimaryComponentTick.TickGroup = TG_DuringPhysics;
	PrimaryComponentTick.bStartWithTickEnabled = true;
	PrimaryComponentTick.bCanEverTick = false;  // bCamEverTick is false
	PrimaryComponentTick.bAllowTickBatching = true;
	PrimaryComponentTick.SetTickFunctionEnable(false);

you need override constructor