How do I change the intensity of a point light in a custom contoller?

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;

I figured this out.

The pointlight component needs to be set to ‘Movable’ in the details tab in Unreal to allow changes to the lighting during play.

Then using the following worked for me:

Owner->FindComponentByClass(<UPointLightComponent>)->SetIntensity(0.0f);