From f1c2ac0ec6f25674c1aa4e8333e4aac59541d3bd Mon Sep 17 00:00:00 2001 From: Louis Hobbs Date: Thu, 15 Jun 2023 22:44:26 +0100 Subject: [PATCH] Add PointLightComponent to WeaponPickup --- Source/Nakatomi/WeaponPickup.cpp | 5 +++++ Source/Nakatomi/WeaponPickup.h | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/Source/Nakatomi/WeaponPickup.cpp b/Source/Nakatomi/WeaponPickup.cpp index 75bbffb..f7125b3 100644 --- a/Source/Nakatomi/WeaponPickup.cpp +++ b/Source/Nakatomi/WeaponPickup.cpp @@ -16,6 +16,11 @@ AWeaponPickup::AWeaponPickup() SphereComponent->SetCollisionEnabled(ECollisionEnabled::QueryAndProbe); SphereComponent->SetupAttachment(RootComponent); + + PointLightComponent = CreateDefaultSubobject(TEXT("PointLightComponent")); + PointLightComponent->SetLightColor(FLinearColor::White); + PointLightComponent->SetupAttachment(RootComponent); + } // Called when the game starts or when spawned diff --git a/Source/Nakatomi/WeaponPickup.h b/Source/Nakatomi/WeaponPickup.h index 9b6a09d..49f6fe8 100644 --- a/Source/Nakatomi/WeaponPickup.h +++ b/Source/Nakatomi/WeaponPickup.h @@ -2,6 +2,7 @@ #pragma once +#include #include "Components/SphereComponent.h" #include "CoreMinimal.h" #include "GameFramework/Actor.h" @@ -47,6 +48,9 @@ private: FWeaponProperties WeaponProperties; + UPROPERTY() + UPointLightComponent* PointLightComponent; + public: // Sets default values for this actor's properties AWeaponPickup();