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