I’m doing the lesson with constructors in the cryptraider section. I simply can’t get the ulog message in the TickComponent to print in the output log, so I have no idea if the trigger component is actually working as it should.
This is my TriggerComponent.h:
#pragma once
#include "CoreMinimal.h"
#include "Components/BoxComponent.h"
#include "TriggerComponent.generated.h"
UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
class CRYPTRAIDER_API UTriggerComponent : public UBoxComponent
{
GENERATED_BODY()
public:
UTriggerComponent();
protected:
virtual void BeginPlay() override;
public:
virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
};
And this is my TriggerComponent.cpp:
#include "TriggerComponent.h"
UTriggerComponent::UTriggerComponent()
{
PrimaryComponentTick.bCanEverTick = true;
UE_LOG(LogTemp, Warning, TEXT("Trigger Component Is Active"));
}
void UTriggerComponent::BeginPlay()
{
Super::BeginPlay();
UE_LOG(LogTemp, Warning, TEXT("Trigger Component Is Alive"));
}
void UTriggerComponent::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
{
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
UE_LOG(LogTemp, Warning, TEXT("Trigger Component Is Ticking"));
}
The ulog messages is the constructor and BeginPlay shows up in the output log, but not the ulog message in the TickComponent. Why?