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.
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.
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.
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.
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?
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!