void AFPSCharacter::SetLightsColor(float R, float G, float B)
{
FString strPreFix = "light_";
TActorIterator<ALight> AllActorsItr = TActorIterator<ALight>(GetWorld());
while (AllActorsItr)
{
FString strName = AllActorsItr->GetName();
if (strName.Contains(strPreFix, ESearchCase::CaseSensitive))
{
AllActorsItr->SetLightColor(FLinearColor(FColor(R,G,B)));
}
++AllActorsItr;
}
}
i use this code to change all lights color at runtime. run in editer,it’s ok.
but run in shipping game,it’s have on effect。
how can i do?