Extended CameraComponent does not Tick?

Hi,

I want to extend CameraComponent to have a custom transform but for some reason it doesn’t tick.

My Code:

UCLASS()
class MYGAME_API UMainCharCamComponent : public UCameraComponent
{
	GENERATED_BODY()
	
public:

	FTransform OldTransform;
	
	FTransform NewTransform;

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

CPP

#include "MyGame.h"
#include "MainCharCamComponent.h"


void UMainCharCamComponent::TickComponent(float DeltaTime, ELevelTick TickType, 

FActorComponentTickFunction* ThisTickFunction)
    {
    	Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
              //SOME CODE
    }

Inside the Constructor of MainCharacter.cpp

ThirdPersonCamera = CreateDefaultSubobject<UMainCharCamComponent>(TEXT("ThirdPersonCamera"));

Is there a reason why this custom CameraComponent doesn’t tick?

Cheers,

I think you have to set

PrimaryComponentTick.bCanEverTick = true;

in the constructor.

glad I could help. :slight_smile:

Thanks, I can’t believe I forgot about this.