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"

Float data from Level BP to Widget BP

Hey guys, I've been struggling with this for a few days now. I've set up a simple timeline system to handle the day/night cycle of the game world. It has two tracks, one controlling the rotation of the sun, one for the time (0-24.)

I've tried copying and altering various examples to other people's similar problems however none of them are working.

I'm trying to create a few widgets that will use the float value. One to display the time, one to display the time remaining until sunset/sunrise. I also need the value so I can script some warning pop ups for the HUD.

Does anyone know the easiest way to do this?

Here's a picture of the blueprint. alt text

Product Version: UE 4.8
daynightcycle.jpg (181.5 kB)
more ▼

asked Jul 23 '15 at 04:37 PM in Blueprint Scripting

avatar image

35 1 4 11

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

1 answer: sort voted first

Hello @BallistikBiskit,

I think I have a good solution for you. It is a little long, but it will get the job done.

First I will go over my level Blueprint setup.

I used my level Blueprint to create and store my widget as you can see in the picture below.

alt text

Next I created a simple variable called "TestVar" and set its value in the Tick method of my Level Blueprint. This variable was only created for testing my methods. In your case you might want to use your values for displaying the time.

In the Tick method of my LevelBlueprint, I am assigning a value to my TestVar and am calling a function on my widget called "UpdateTestVar." We will create this method in our widget later. Below is a picture of my setup.

alt text

Secondly we will go into my widget setup.

First I create my widget using the editor and named my widget "TestWidget". My "TestWidget" has two import functions which allow it update and display the value of the variable from my Level Blueprint. It also has a variable called "WidgetVar" that stores the value of the variable getting displayed.

The picture below is of the first function called "UpdateTestVar." All it does is to set the value of the "WidgetVar" variable to a specific input. A picture of this is shown below.

alt text

The second function is used to update the text field of my widget. You have to create this function in a unique way. First go to the Designer tab of your widget and select the text field you are working with. Then look in the Details panel for a category called "Content". Next you should see a field called "Text" with a drop down box next to it. Choose the "Create Binding" option in this drop down to create your function as seen in the picture below.

alt text

Now go to this newly created method and use it to insert the value of your widget variable into your text field as seen below.

alt text

So now you should have a widget that is receiving a value from your Level Blueprint and is drawing that value onto the screen.

I know this tutorial was a little long so feel free to ask any questions in the comments below.

I hope this answer helps,


testwidget 1.png (60.4 kB)
testwidget 2.png (70.2 kB)
testwidget 3.png (22.9 kB)
testwidget 4.png (58.2 kB)
testwidget 5.png (39.6 kB)
more ▼

answered Jul 23 '15 at 10:54 PM

avatar image

493 53 39 57

avatar image BallistikBiskit Jul 24 '15 at 01:52 AM

Hello Farshooter, First off, thanks for taking the time to reply and explain, I really appreciate it. I've copied everything I can following your steps, however I've inevitably ran into a problem.

when trying to place the circled nodes, they aren't coming up as an option in the list. I've tried unchecking the 'context sensitive' box, and still nothing. any idea why this is?

alt text alt text

I'm having the same problem with referencing the 'widget var' node in the last step.

alt text

thanks again for your help!


bpexample_01.jpg (103.7 kB)
bpexample_02.jpg (107.1 kB)
bpexample_03.jpg (72.4 kB)
avatar image BallistikBiskit Jul 24 '15 at 11:27 AM

Never mind! I've got it to work. So the two missing nodes weren't necessary for it to function, here's a picture of my set up. alt text

Also the reason the 'WidgetVar' wasn't showing up for me was because I had created it as a 'local varible' rathen than in the normal variables tab. after i fixed that and compiled, it worked!

alt text

Thanks again farshooter.

fixedit_01.jpg (156.8 kB)
fixedit_02.jpg (68.5 kB)
(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