x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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.

Product Version: Not Selected
Tags:
more ▼

asked Apr 24 '15 at 06:07 PM in Blueprint Scripting

avatar image

ghuuuu
46 7 7 13

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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.

more ▼

answered Apr 24 '15 at 06:11 PM

avatar image

RyanB STAFF
2.1k 56 24 118

avatar image RyanB STAFF Apr 24 '15 at 06:19 PM

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:

alt text

gdc_tod_bp_pc.jpg (56.1 kB)
avatar image ghuuuu Apr 25 '15 at 04:01 PM

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 alt text

Actor BP alt text

Timeline alt text

Print String Function alt text

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.

character bp.jpg (185.5 kB)
actor bp.jpg (194.8 kB)
timeline.jpg (96.9 kB)
avatar image RyanB STAFF Apr 25 '15 at 10:25 PM

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.

avatar image ghuuuu Apr 28 '15 at 01:16 PM

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!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question