Day / Night Cycle with state
I have checked lots of forum and hub questions related to this question (lots of topics around there) yet couldn't find the tip I am looking for. Anyway, I was experimenting different conditions with the blueprint system. Since I am pretty new in Unreal Engine, I have a few questions related my day / night cycle attemt. First of all, I will be trying to push my limits forward by making my scene as realistic as I can. Therefore it will use a lot of GPU, so I will try to decrease the CPU / GPU usage to prevent more hassle.
Here is my question: I am trying to create 2 states: Day and Night. With a key input, it will switch the state. Imagine sandbox games where day/night cycles effect the whole city lights. Hopefully, I have only one flat
In day state:
In night state:
I have already created the cycle with a timeline to demonstrate the flow and attached one of my light BP's to make them on and off. It is working flawless, yet considering I have other light sources needs to be BP and codes within them, it sounds like I am computing unnecessary things.
I have something in my mind to simplify that logic above, but not sure if it will work. Is there a way to create such states within a variable so I can simply get Sun position to determine if different light bp's are all on or off? I have doodled the states into nodes with pen, and logically it makes sense yet I have no idea how to achieve those with real unreal nodes.
I imagined Day and Night states predefined seperately in BP's and cast to Level BP where the sun state calculated to set a state into 1 and the other 0 (or switch, haven't used it tough) If this makes sense, am I supposed to get all scene lights into those state BP's to set all values 1 or 0? If so, how is it possible to cast 1 from Level BP to those states to activate different light sources?
Sorry if I made it more confusing with my ideas :) Thanks so much for your help!
asked Mar 21 '15 at 11:03 AM in Blueprint Scripting
Finally I managed to solve the Day/Night Cycle BP! Now it is working flawless. As I promised above, here is the BP I used. I am sure there are better ways to make it more performance efficient, yet that's all I could do for now. Hope this helps!
To sum it up First of all, I tagged every light as night or day in order to group them in blueprint to prevent toggling them one by one.
On Event Begin Play;
On Key Input
Here is the Level BP I made
answered Mar 21 '15 at 03:17 PM
HI! can you please upload the image bigger? it's hard to see ^_^
answered Sep 08 '17 at 05:44 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here