change dynamic shadow distance movablelight at run

I d like to change dynamic shadow distance movablelight at run, so at zoomed in distances its a smaller number. You can change this value at run from the out liner so i dont see why you shouldnt be able to change it in a blueprint but i cant seem to find any of the set cascade shadow settings in the blueprints. You can add directional lights, so you should be able to define their parameters as well

after more digging I ve found I can change this setting on a directional light created in the blue print (add directional light component) but I cant seem to access it from the one in the level. The one in the level is giving my light component attributes instead of a directional light component.

Hi Kerberos,

It seems like your issue is resolved if you use the directional light as a component in a blueprint rather than trying to access a reference to a light placed in the map. Is there a reason why you wont use the blueprint component version?

Its nice to be able to adjust settings of the light on the map as opposed to in a blue print where you have to compile every time out of screen etc. The solution I m thinking of doing is making a blueprint that exposes controls of the light that i want and adjusting them from that. If the answer is that its not possible to access properties of an exsiting light in a level then okay. If there is then I d like to know how.

Hi Kerberos,

I apologize for the super late response. This post was removed from my queue by mistake so I wasn’t getting any notifications from your comment. Anyway, what you are asking for is very possible so I’ve attached a demo project with the functionality you’ve asked for.

All you have to do is in the construction script get access to the dynamic shadow distance and set the value based off of an exposed variable. Just change the value highlighted in the screenshot and you should see the shadow distance change without having to compile.

To set the distance on a placed directional light, you need to get the light component and cast it to DirectionalLightComponent, so that you can access that variable, see below.