Automatically update material by

Hello everyone!

So, I have a question about automatically update material by sun direction. The point is I have Day/Night cycle, and I also have material which need to be refreshed if sun direction changes. So, I have a blueprint which contain sun direction node, and placed in to the material. But, I really need to know how to refresh materials automatically?

This is the screenshot of my blueprint which contained sun direction node.

You need to do it in Event Graph instead of Construction Script and execute the function either with Event Tick or with a Timer.

So, do u mean that I need to delete all of construction script, or I can just copying set my construction to the main event tick for sun trajectory or sun direction?

Oh dude, really thanks it helps too much!!!

No problem. Btw, you dont need to set that bool to false with the branch’s True pin. What you have currently doesnt have any effect so get rid of the set bool, plug Set vector parameter to True and unplug it from False. Now you can control whether it should update or not by the refresh bool anytime and anywhere you like.

So, why I need to have branch node in this case?
That things do u mean?

this way doesn’t working, except my previous version of construction script

You need to set the default value of the bool to True for this to work. And you dont need to use a branch if you dont need to enable/disable this function in runtime.

Thanks, it works fine! The question is resolved!

where can I find mpc_sunDirectionalLight???