Add PointLightComponent to WeaponPickup

This commit is contained in:
Louis Hobbs 2023-06-15 22:44:26 +01:00
parent 11724a9426
commit f1c2ac0ec6
2 changed files with 9 additions and 0 deletions

View File

@ -16,6 +16,11 @@ AWeaponPickup::AWeaponPickup()
SphereComponent->SetCollisionEnabled(ECollisionEnabled::QueryAndProbe);
SphereComponent->SetupAttachment(RootComponent);
PointLightComponent = CreateDefaultSubobject<UPointLightComponent>(TEXT("PointLightComponent"));
PointLightComponent->SetLightColor(FLinearColor::White);
PointLightComponent->SetupAttachment(RootComponent);
}
// Called when the game starts or when spawned

View File

@ -2,6 +2,7 @@
#pragma once
#include <Components/PointLightComponent.h>
#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();