From b51f3a7a346252a0ed8d653b8fb4fa08e5998dd2 Mon Sep 17 00:00:00 2001 From: Louis Hobbs Date: Sat, 24 Jun 2023 15:25:06 +0100 Subject: [PATCH] Moving setting of light colour to BeginPlay --- Source/Nakatomi/Pickup.cpp | 2 +- Source/Nakatomi/Pickup.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/Nakatomi/Pickup.cpp b/Source/Nakatomi/Pickup.cpp index aea5baa..522c309 100644 --- a/Source/Nakatomi/Pickup.cpp +++ b/Source/Nakatomi/Pickup.cpp @@ -19,7 +19,6 @@ APickup::APickup() SphereComponent->SetupAttachment(RootComponent); PointLightComponent = CreateDefaultSubobject(TEXT("PointLightComponent")); - PointLightComponent->SetLightColor(FLinearColor::FromSRGBColor(LightColor)); PointLightComponent->SetupAttachment(RootComponent); } @@ -29,6 +28,7 @@ void APickup::BeginPlay() Super::BeginPlay(); SphereComponent->OnComponentBeginOverlap.AddDynamic(this, &APickup::OnOverlapBegin); + PointLightComponent->SetLightColor(FLinearColor::FromSRGBColor(LightColor)); PointLightComponent->SetWorldLocation(this->GetActorLocation()); } diff --git a/Source/Nakatomi/Pickup.h b/Source/Nakatomi/Pickup.h index 7519ab3..a9135dc 100644 --- a/Source/Nakatomi/Pickup.h +++ b/Source/Nakatomi/Pickup.h @@ -8,6 +8,8 @@ #include "GameFramework/Actor.h" #include "Pickup.generated.h" + +// TODO: We probably want to add some extra stuff here, particle effects, sounds, etc UCLASS() class NAKATOMI_API APickup : public AActor {