I have a point light actor, and I want to change it’s intensity when the player enters a trigger volume. The code is reaching the right place, but I can’t get it to change intensity.
I have tried a bunch of different ways to get it to work, but can’t figure it out. Am I missing something obvious?
From my understanding, GetOwner() should return me the Actor for the light. I’m trying to use FindComponentByClass() to find the PointLightComponent. I want to set the intensity of that component to 0.0f.
Essentially I have:
Owner = GetOwner();
...
Cast<APointLight>(Owner)->LightComponent->SetIntensity(0.0f);
Owner->FindComponentByClass<ULightComponent>()->SetIntensity(0.0f);
Owner->FindComponentByClass<UPointLightComponent>()->SetIntensity(0.0f);
Owner->FindComponentByClass<UPointLightComponent>()->Intensity = 0.0f;