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

**URL:** <https://forums.unrealengine.com/t/how-do-i-change-the-intensity-of-a-point-light-in-a-custom-contoller/370788>\
**Category:** Rendering\
**Tags:** unreal-engine\
**Created:** [September 17, 2016, 2:54pm UTC](https://forums.unrealengine.com/t/how-do-i-change-the-intensity-of-a-point-light-in-a-custom-contoller/370788 "2016-09-17T14:54:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_a94199f2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_a94199f2](https://forums.unrealengine.com/u/anonymous_user_a94199f2)\
**Post date:** [September 17, 2016, 2:54pm UTC](https://forums.unrealengine.com/t/how-do-i-change-the-intensity-of-a-point-light-in-a-custom-contoller/370788/1 "2016-09-17T14:54:58Z")

</div>

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:

 ![107443-pointlight.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/6/9/269c373087999cc1b7a3c03239febb9c7a9451d4.jpeg)

```
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;

```

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_a94199f2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_a94199f2](https://forums.unrealengine.com/u/anonymous_user_a94199f2)\
**Post date:** [September 18, 2016, 4:11am UTC](https://forums.unrealengine.com/t/how-do-i-change-the-intensity-of-a-point-light-in-a-custom-contoller/370788/2 "2016-09-18T04:11:46Z")

</div>

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);

```
