This code:
ASpotLight *Light = GWorld->SpawnActor<ASpotLight>(ASpotLight::StaticClass());
Light->SetBrightness(100000);
Light->SetOuterConeAngle(5.0);
Produces:
LNK2019 unresolved external symbol "public: void __cdecl ASpotLight::SetOuterConeAngle(float)" (?SetOuterConeAngle@ASpotLight@@QEAAXM@Z) referenced in function "public: void __cdecl ATestGeomActor::RegenLighting(void)" (?RegenLighting@ATestGeomActor@@QEAAXXZ)
Yet right-clicking on SetOuterConeAngle in VS and finding the definition yields an actual definition, in SpotLight.cpp:
void ASpotLight::SetOuterConeAngle(float NewOuterConeAngle)
{
SpotLightComponent->SetOuterConeAngle(NewOuterConeAngle);
}
I need to set the outer cone angle of a dynamically created spot light. I’m not sure how to proceed.
I found this similar report, but I cannot make sense of the OP’s posted “resolution”:
i have modify the scriptplugin, it just call the target function without use Processevent
I also found this identical report from 2 years ago but it went unanswered. It was also for an older version of the engine.
As a shot in the dark I tried:
Light->SpotLightComponent->SetOuterConeAngle(5.0);
Which compiled, but did not actually change the outer cone angle from the default value.