Create a clock from an actor rotator

Hi all,

I’m trying to create a day night system where NPC will react depending of the time (like go to bed during night).

I have the light cycle by rotating the Light Source by “AddActorRotation”.

Now I found on the net a lot of tuto to caculate the clock just by adding values to the seconds but sometimes if you pick a slow “day speed” for the rotation, the hours are delayed from the light cycle resulting in inaccurate calculation.

So I would like to get the minutes of the day from the rotator of the light actor. Unfortunately it’s not just a 0->360 rotation. It’s more like 0->90->0->-90 or something like this resulting in something ugly that I can get to work.

I just want to get the time of day depending to the rotation of the light so that it’s more accurate. Is there a solution here?

Or do you have a better solution for an ingame clock?

Thank you in advance