Connecting Level Blueprint and HUD Widget blueprint

Yo mates:

TASK:

Press a button in Main menu HUD to change the time of day to day or night. The level beings by night in default. The Main Menu widget is in the same level as game.

VARIABLES:

Directional light, Sky sphere

LEVEL Blueprint (Works):

Here I have assigned a button ‘i’ to change from night to day. This works perferctly. Even in main menu if I press ‘i’ the night changes to day.

WIDGET Blueprint (same code, doesnt work):

Here the Keepo var is directional light BP and sky sphere var is sky sphere BP. So when I click play, it should change the sun direction. Same code as level one, but this doesnt work.
Is there a problem with the actor BP reference then?

THanks for the help mates.

YS

I know there are lots of experts here. Please take like 2 minutes to answer my question pls :frowning:

Ya never mind, as usual not a lot of response.

I am using a round about method of material parameter collection (which is easy to globally use i feel).After creating the parameter from add new>materials and textures, In the widget blueprint if day button is pressed the scalar parameter is 0 and night its 1. So I can use get scalar parameter in the level blueprint and set day when the scalar parameter value = 0 and night when = 1.

Imma start using scalar parameter to communicate between everything from now on.

Another GREAT hack I saw in another thread.

  1. Create custom event in level BP and do all the stuff you wanna do

  2. In HUD BP just execute console command and type ce customevent

works wonders actually. Easy way to connect HUD and level.

can that also work with player bp?