HELP! Communication between Widget and BP?

Hey there! I’m having some trouble trying to get something in movement.

I have a widget that i’m using as screen for a phone I have on the scene. The widget and the phone are different objects. I want to bind some text and a progress bar to some variables on the phone. In a similar scenario I used the Cast to but it doesn’t work (Accesed none trying to read property K2Node_DynamicCast_AsSmartphone_BP from function: ‘Get_FirstHour_Text_0’ from node: Return Node in graph: Get_FirstHour_Text_0 in object: ScreenWidget with description: Accessed None trying to read property K2Node_DynamicCast_AsSmartphone_BP)

Any ideas?

This are the variables:

108468-variables.png

First I would create a Blueprint that contains both your phone and your widget.
Then you can create a variable that let you access your widget:

While you can bind your widget variables to your BP, this is not the most efficient method to do so. I would recommend that you create a macro that is Names SetHealthBarValue, and what it does is set your HealthBar variable value, then it will access the widget and change the health bar, that way you only update your widget when the value changes, instead of every frame.

If you have a text variable in your widget but it doesn’t seam to show up, make sure your text has this checkbox checked:

108439-capture.png

I didn’t get this part: First I would create a Blueprint that contains both your phone and your widget

Create a Blueprint that has your phone Mesh, your phone variables, and your phone widget (Screen). Set the widget component class to the widget you created

108461-capture.png

Done. But where should i cast it?Don’t have any playerhud

PlayerHUD is the name of my widget, you should cast it to the name of your widget

My widget doesn’t appear

uncheck the context dependent checkbox in your search menu

Done. What about the set Phone Screen?

You widget component that you added to your blueprint you should select it and go to it’s detail pannel, and select your widget as your parent class of the widget component

Where do i do that. Sorry I’m a bit noob

In details i’m not seeing how to do that?

Done. Where did you get the Set Phone Screen on the bp?

Also I’m getting this compile error from the Cast to ScreenWidget: Warning ‘Screen Widget’ does not inherit from ‘Scene Component’ ( Cast To ScreenWidget would always fail).

it’s a variable that I created so I don’t have to do a cast each time I want to acess the screen, I just do that once. Just right click the outpust pin of your cast node (ex. “As Player HUD”) and select promote to variable, then name the new variable Phone Screen

show me a screenshot of your BP that include your code, the components, and the warning

This is what I’m trying to copy from your example, just added the set

I’m getting a bit confused

I can’t put all the bp in one screenshot