How to get InputAction from character BP to 'set new time' of a timeline in an actor BP?

Hi guys, I got a sun path system made in a BP using timeline, with time from 0-24, to represent the 24 hours of the day. It works fine, but what I want to do now is to press, for example, a button in UMG or the ‘K’ key and it will jump to a certain time of the day, lets say 12 noon. How can I do it? Thank you.

If you build the blueprint so that a single Time Value drives all of the parameters, then all you need to do is set the CurrentTime to the desired time. In terms of communicating with the character, you could in theory have the character communicate with the TimeofDayBP by doing “get all actors of class” assuming there is only 1 of these blueprints. You could also try storing the time value in a global material parameter collection and looking it up there in the time of day BP.

The GDC Kite demo has a simple example of time of day in blueprints where the time is the only variable controlling it. That will be released with 4.8 next month. If you want I can paste some images of how it is set up.

Parameters for time of sunrise and sunset etc define exactly where the transitions occur. Structs store all lighting/postprocess settings for each time of day.

Here is how we got the TimeOfDay reference for the GDC Kite demo. This is inside of the PlayerController, which is where very general purpose control scheme things are usually done.

Note that it is done on BeginPlay, and then the found actor is assigned to a Variable. This means we only need to perform the wasteful “find” function once at startup and then we have a direct reference to act on:

Fantastic! It worked for me. Thank you for the help. I have always been confused about what get actors of class is for, and connections between BPs, even after reading the documentation. And it now works. However, Here I have a screenshot of how it works, I am just wondering whether if there is a simpler efficient way to do my BPs, maybe I am doing redundant things.

Character BP

Actor BP

Timeline

Print String Function

One last question, I have the time print string correctly, except for when its 12 midnight, it shows as 0:23 AM, how would I go about getting it to show 00:23 AM instead? Thank you.

I think your solution for driving the rotation directly via timeline is interesting. Since you are bypassing a bunch of rotator math by specifying the curve directly, that might be a tad more efficient than the approach I used when doing this.

Also your string based conversion of time from a float into a clock just needs to handle the 1 digit case in the lower left “get substring” node. You could check if length of that substring is 1 and append it to another 0. Or you could use the convert float to text node which lets you specify all the digit lengths min and max. Then go from text to string again.

Thank you for the help, I got it all working, and from your example I learnt how to communicate between blueprints, and were able to do much more than before. Thanks a bunch!