Hi, i’m trying to create some spotlights for a game i’m creating but i’m having some trouble setting the spotlights cone values when i’m trying to create them.
I get this error when i try to compile my code
Error 1 error LNK2019: unresolved external symbol "public: void __cdecl ASpotLight::SetOuterConeAngle(float)" (?SetOuterConeAngle@ASpotLight@@QEAAXM@Z) referenced in function "public: virtual void __cdecl ALightOrigin::BeginPlay(void)" (?BeginPlay@ALightOrigin@@UEAAXXZ) C:\Users\Joar Hedvall\Documents\Unreal Projects\Temple\Intermediate\ProjectFiles\LightOrigin.cpp.obj
But if i remove the part where is set the cone angle, i can compile and run with no issues.
This is my light creating code currently.
In Header
UPROPERTY(VisibleAnywhere, Category = "Switch Properties")
TArray<ASpotLight*> SpotLights;
In cpp
void ALightOrigin::BeginPlay()
{
Super::BeginPlay();
for (int i = 0; i < ReflectionCountMax; i++)
{
if (GWorld && SpawnLight)
{
ASpotLight* SpotLightTemp;
SpotLightTemp = GWorld->SpawnActor<ASpotLight>(ASpotLight::StaticClass(), GetActorLocation(), GetActorRotation());
SpotLightTemp->SetBrightness(Brightness);
SpotLightTemp->SetEnabled(true);
SpotLightTemp->SetOuterConeAngle(2.0f);
SpotLights.Add(SpotLightTemp);
}
}
}
Am i doing something wrong when i’m creating the lights or are you not supposed to set the cone values at that point and if so, where do i set their values.
// Thanks