After fighting with the tick not ticking all morning, I finally got that sorted out. The correct header files are attached.
I have tried Updating the project from the editor, closing and rebuilding from VS Code, adding and removing the component.
CPP
// Fill out your copyright notice in the Description page of Project Settings.
#include "TriggerCompononet.h"
UTriggerCompononet::UTriggerCompononet()
{
// Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features
// off to improve performance if you don't need them.
PrimaryComponentTick.bCanEverTick = true;
// ...
}
void UTriggerCompononet::BeginPlay()
{
Super::BeginPlay();
}
void UTriggerCompononet::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction *ThisTickFunction)
{
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
UE_LOG(LogTemp, Display, TEXT("TickComponent called"));
TArray<AActor *> OverlappingActors;
GetOverlappingActors(OverlappingActors);
if(OverlappingActors.Num() > 0)
{
FString ActorName = OverlappingActors[0]->GetActorNameOrLabel();
UE_LOG(LogTemp, Error, TEXT("Overlapping with %d actors"), *ActorName);
}
}
HEADER
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Components/BoxComponent.h"
#include "TriggerCompononet.generated.h"
/**
*
*/
UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent))
class GDTV_CRYPTGAME_API UTriggerCompononet : public UBoxComponent
{
GENERATED_BODY()
public:
// Sets default values for this component's properties
UTriggerCompononet();
protected:
// Called when the game starts
virtual void BeginPlay() override;
public:
// Called every frame
virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
};