# The function to set the cone angles (inner and outer) for SpotLightComponent doesn't work.

**URL:** <https://forums.unrealengine.com/t/the-function-to-set-the-cone-angles-inner-and-outer-for-spotlightcomponent-doesnt-work/1249081>\
**Category:** Devices\
**Tags:** Python, unreal-engine, bug-report\
**Created:** [August 3, 2023, 5:04am UTC](https://forums.unrealengine.com/t/the-function-to-set-the-cone-angles-inner-and-outer-for-spotlightcomponent-doesnt-work/1249081 "2023-08-03T05:04:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![May-B\_15](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@May-B\_15](https://forums.unrealengine.com/u/May-B_15)\
**Post date:** [August 3, 2023, 5:04am UTC](https://forums.unrealengine.com/t/the-function-to-set-the-cone-angles-inner-and-outer-for-spotlightcomponent-doesnt-work/1249081/1 "2023-08-03T05:04:35Z")

</div>

The function to set the cone angles (inner and outer) doesn’t work.  
According to this part of the Python API docs( [unreal.SpotLightComponent — Unreal Python 5.0 (Experimental) documentation](https://docs.unrealengine.com/5.0/en-US/PythonAPI/class/SpotLightComponent.html#unreal.SpotLightComponent.set_outer_cone_angle) ) this function should change the cone angle of the SpotLight(Component) doesn’t do anything at all,

```auto
cone_angle = 30
sl = eas.spawn_actor_from_class(unreal.SpotLight,l)
slr = sl.root_component
slr.set_outer_cone_angle(cone_angle)

```

The above code doesn’t set the outer cone angle and it stays at the default value.

Anyone else struggling with this can use this instead:

```auto
cone_angle = 30
sl = eas.spawn_actor_from_class(unreal.SpotLight,l)
slr = sl.root_component
slr.set_editor_property('outer_cone_angle',cone_angle)

```

---

<div class="post-metadata">

**Author:** ![Imaver](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Imaver](https://forums.unrealengine.com/u/Imaver)\
**Post date:** [December 20, 2023, 11:50am UTC](https://forums.unrealengine.com/t/the-function-to-set-the-cone-angles-inner-and-outer-for-spotlightcomponent-doesnt-work/1249081/2 "2023-12-20T11:50:00Z")

</div>

hi Mayank Bawari,  
Thank you so much for taking the time to post this - I just encounter the same case with Blueprints, if I set cone angle using spot light component it does not work.

I adapted your python script to blueprints, here is setup that works on my side, hopefully it could be helpful to someone who encounters the same issue:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/5/d/65d8bec497b7261af4e82444b273d79ce6c7c5de.jpeg)
