Widget text always show the default value

I design a camera HUD which can display the current camera moving speed, and I can change the speed in the camera blueprint. For displaying the current speed, I create a custom event to pass the speed value to HUD Widget Blueprint. just like below:



but it doesn’t work, the text keeps be the defalut value 100. And then I print the value, it’s actually pass the right value and change the local variable(CameraSpeed) in HUD Widget Blueprint.

~VC_7BA$CWQQ9}{Y}R@UKNY
It’s good in Event Graph, but in the binding function, the Get cameraSpeed Node alway get the default value(100) whether the value changes or not.


How to make the text be the right value?

Hi! If you directly insert the new speed into the UI text instead of binding a function, the displayed value is correct or remains the default?

It remains the default. Thanks for your reply:)

How are you creating the HUD?

new a widget blueprint, create it at the BeginPlay Node in the Level blueprint and add to viewport when the controller is camera

I’ve tried this :thinking:

Level BP:

Widget:
image

Before:
image

After:
image

Other method:
Binding in Widget BP: (Num by default is 0)


image

Level BP:

Before:
image

After:
image

2 Likes

Thanks! :grinning: I figure out my problem, I create widget twice in different blueprint, I add to viewport in the level blueprint. But I call the event in the camera blueprint, the change in camera blueprint does not display.

You’re welcome :smile:
Glad you found it!