Get All Light Sources?

Does anyone know if there’s a blueprint method for getting references to every directional light on the map?

I’m looking for a way to toggle all the lights on the map, without making explicit hard references to each light (this code would be packaged into a mod, so it would have to be able to operate on any level).

Thanks!

Hi RedDwarf,

in Blueprint you can use [Get All Actors of Class][1] node filtered by Directional Light Actors class.

If you want to find DirectionalLightComponents added in user defined Blueprint classes you’ll need to build a more complex script with Get All Actors of Class filtered on actor then find directionnal components in each one.

1 Like

Thanks Co!

You’re exactly right. I had a “wait, is it really that easy?” moment last night, and I built out an entire fuction that found every type of light source via the GAAOC node, and it worked like a charm.