So this may be a simple question, but i’m having trouble adding Variable number to a UMG widget. I’m trying to make a BPM monitor and I have made a Random Float in Range inside the Widget Blueprint, but i’m lost on where to go from here. So I have the text block with ‘BPM’ written in it, i’m trying to add the random number before ‘BPM’. For example, ‘67 BPM’. I’m relatively new to UE4 and i’m kinda confused so thanks in advance.
Hello AeminBarz
Here is my solution to your problem:-
- Add a horizontal box and make sure it is sized to content.
- Add to it a text and make sure it is empty and a variable, and add to it also a spacer and make its (size x) for example 20 , and then add another text “BPM”.
- On the first text click on bind and choose (create a binding).
- Create a new variable of the float type and get it and then connect it to the return value.
- Now you have a variable that is bound tofirst text , so if that variable value change , the first text will also change, so for example if you generated a random float in range and set it to the variable it will change on the screen.
I am having an issue displaying my float value.
My function retrieves a float from my character via casting and fails to display it. It does not even pick up on a cast fails, and thinks that cast is successful.
I figured it out, it was the return nodes and truncating a float.
Iam glad my solution helped you , and hoping to hear from you in future problems