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

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 ) this function should change the cone angle of the SpotLight(Component) doesn’t do anything at all,

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:

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)
1 Like

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:

1 Like