I’m having a problem accessing a point lights attentuation radius. Right now my tick method in my cpp file is as follows
void AASCharacter::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
TArray<AActor*> PointLights;
UGameplayStatics::GetAllActorsOfClass(this, APointLight::StaticClass(), PointLights);
for (int32 i = 0; i < PointLights.Num(); i++)
{
APointLight* Light = Cast<APointLight>(PointLights[i]);
if (Light)
{
FVector EyeLocation;
FRotator EyesRoation;
GetActorEyesViewPoint(EyeLocation, EyesRoation);
float Distance = (Light->GetActorLocation() - EyeLocation).Size();
if (Distance > Light->PointLightComponent->AttenuationRadius)
{
}
}
}
}
My header file is:
#pragma once
#include "Engine/PointLight.h"
#include "Engine/Light.h"
#include "Components/LightComponent.h"
#include "Kismet/GameplayStatics.h"
#include "CoreMinimal.h"
#include "GameFramework/Character.h"
#include "ASCharacter.generated.h"
UCLASS()
class ESCAPEROOM_API AASCharacter : public ACharacter
{
GENERATED_BODY()
public:
// Sets default values for this character's properties
AASCharacter();
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
public:
// Called every frame
virtual void Tick(float DeltaTime) override;
// Called to bind functionality to input
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
};
However, I’m having problems with the following line of code: Light->PointLightComponent->AttenuationRadius
In my editor it is telling me I don’t have access to an incomplete class. I have a feeling that this is down to a missing header file but I don’t know which header to include. Could someone please tell me what I should do?