How to stop the daily cycle

There are literally dozens of tutorials on youtube on how to create a day/night cycle using Even Tick. Unfortunately, none of them show how to break this cycle - I need my sun to get to sunset state and stop there. Below is my blueprint, please advise how to modify it. I would like my sun to not rotate any further when it reaches a certain Y rotation value. Or alternatively it can be tied to the SunSpeed variable, I just need my sun to stop rotating at a certain point and I want to somehow determine exactly when. Thanks

if you simulate your game, you can open up this blueprint and hover over your “Y (Pitch)” little green dot there, it will tell you the values in real time on play what float value that is at. you could wait for it to get exactly where you want it. or even easier just adjust the Relative pitch without simulating anything and find the rotation you want it to stop at, both work one is just faster. After you know the value you want, pass a branch off of your tick that relies a result from a “Float greater than or equal to” (Float >=) the value that you noted earlier. and pass that node coming from your “x” Float right there. So False it will Add Actor Local Rotation, but when the Y(Pitch) reaches a certain value it will ping true and do nothing. If you want to optimize however, you would pass a “set actor tick” after it hits true and make your sun stop ticking. To reactivate the sun I would pass code from something else that shoots a custom event in this blueprint that would turn it back on.

1 Like

To further reply, try these nodes: blueprintUE link.
EDIT: Sorry, I meant to put a SetActorRotation node at the end instead of AddActorRotation.

1 Like

Thanks a lot for the replies, anyway Event Tick is pretty expensive after all, so I thought I’d try changing the rotate Y value of the light simply using timeline and it seems to work!

2 Likes