I really struggled with this lecture

I have some questions, that I hope someone can clear up for me, as I didn’t understand a lot of this lecture!

  1. What does the Get User Widget Component node actually do?
  2. Why do we need to cast the return result to a HealthBar when the Widget Class on the Widget Component is already set to the HealthBar blueprint?

1.- It simply returns a User Widget object, that’s all it does; not complicated.
2.- The previous answer should respond your second question. If you check the UI widget BP you created in this lecture, in the top-right corner you will see it’s inheriting from User Widget, so it was neccesary to cast the user widget obtained from the method to get the health bar BP.

I guess what confused you was the fact that we set the widget component in its details panel as a BP_HealthBar so we should have a direct reference to that object but it’s a wrong conception, that’s it. Maybe the purpose of this setting is another funcionality of this component.

Let’s take into account that this component is in a experimental state, as the instructor indicates in this lecture. Hope I helped you, have good day.

Hello Edgar
I have two questions:
Health

  1. by this line what relationship is between HealthBar widget and widgetComponent (in Tank_BP). we attach one to another or What is the attitude between them?

SetMyTank

  1. As I guess all this Cast we did for to Set MyTank variable as a reference of Tank_BP, but not clear for me why we need it we already have variable MyTank, which is a reference of Tank_BP, in HealthBar. So what this Setter is doing, but without it code is not working?

Privacy & Terms