Moving setting of light colour to BeginPlay
This commit is contained in:
parent
bbe5f04b72
commit
b51f3a7a34
|
@ -19,7 +19,6 @@ APickup::APickup()
|
|||
SphereComponent->SetupAttachment(RootComponent);
|
||||
|
||||
PointLightComponent = CreateDefaultSubobject<UPointLightComponent>(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());
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue