Simple Day Night Cycle on System Time

Hi all,

Still very new to blueprints and coding. I’m trying to build a simple day/night cycle based on the system time (or in multiplayer server time).
This is what I came up with. Can anybody confirm if this is right? I cant check if this is working because the sun turns to slow :o

Im not sure on all the math or not would have to check myself but off the bat you’re setting clock work then its not connected to set actor rotation, but you should have all that connected to an “Event Tick” so it continually updates. An “Event Begin Play” only does this once. Hope you get it man gl :slight_smile:

You can use an multiply node between your clock variable and make rotator node to speed it up just to check if it is working.

Sorry, Im still very new to coding and blueprints. Cant fully understand what you mean.

Tried, and I think the cycle doesn’t work

What onimike means is remove the beginPlay node and replace it with tick event. And connect Clock work set to SetActorRotation than it should work.

Thanks, that works. Only another problem arises, with multiplayer it only works with player 1. So it’s still on the client side I think? I did use the switch has authority and set the variables to replicated.

You need to set the sun update and rotation in the client also. Now you only set the variables but on client side the variables are not used. I’m still looking at multiplayer stuff myself but you need to call an event on client to set the rotation and sun.

It seems to work now, I pulled the “remote” node from the “switch has authority” unto the “Set Clock Work”. Now they are synchronized on both players.

Thx for your help and tips.