I have Blueprint Class which contains a Widget Blueprint (so I can spawn it into the world, like widket in 3D space), and that Widget Blueprint have some Text components, for example with name “Name”, how can I access that Text component Name through Blueprint Class?
Because I want to change text in Widget Blueprint through Blueprint Class.
Thank you for reply, but I have that Widget inside another Blueprint Class, and I want to change it from another Blueprint Class (that class has tag called “projector”).
Look:
Widget Component can’t contain a Text Component, which is added in the menu you see in the image above. You must mean a Text Widget, right?
Have a look at SenToRious’ answer. That’s precisely how you access a normal widget embedded in a widget component.
To answer your question directly:
I get into the Blueprint Class using
tag, but then I don’t know how to get
into that Widget inside that Blueprint
Class. I hope you understand me
When you create a widget inside the actor, create a reference by right clicking the Return Value pin and promoting it to a variable. This will allow you to access it later:
As you can see I cast to Projector (Blueprint Class which contains Widget Blueprint) and then I access variable ProjectorWidget (I Promoted it to Variable as you said) and from that reference I cannot access any Text inside Widget Blueprint.
If you combine my first answer with your reply on @Everynone answer, you’ll have your answer. Drag a pin from your ProjectorWidget (you got it from Cast to Projector) and call Get User Widget Object then cast the result to the widget inside of the ProjectorWidget (similar to my image) and now you should have the ability to use that widget class.
Embedded is just the name of my widget, your widget is called Projector Widget. Also, you cannot cast while dragging Execution wires (the white ones), use the data wires, they are context sensitive and will give you a sensible range of choices.
You’re trying to cast to a widget (ProjectorWidget), cast to a widget component instead (Projector).
Take a closer look at the image I posted, especially at the comments. It seems you’re not following it right. You’re trying to cast by dragging the white wire while you should be Getting User Widget Object first.
One note, this will not work in the Construction Script.