Help: Any reason this cast does not work?

Hi All

I am trying to turn my street lights off when I turn my sun off.

Sun turns off, but my casting does not work.

World BP

When Running, but make no difference.

Regards

If that is your world BP and the streetlight BP are in world, you don’t need to cast. Just highlight the streetlight BP and add reference in world BP the same way. It should work then.

Hi

The only problem with that is that I will have 100+ Street Lights and when I reference it, it only references one of them.

Regards

You could try a get all actors of class node then do a for each loop. Then get light from the loop. Or you may have to cast from loop to streetlight BP then get light.

Hi

Something like this.

No try get all actors of class, drag a line off out actors and type loop and it should give you the right loop node, then from loop node drag a line from the blue output and type cast to streetlights or whatever the blueprint is called. Then from the cast to node you should be able to get any variable within that blueprint if you drag a lineand type get or set.And all actors in world will react.

Hi

Will give that ago.

Regards

this should work

Hi

Seems to work fine.

Thank again.