Widget variables lose references when change widget

Hi, I’ve got two widgets filled with buttons.
In the widget1 i modify all the brushes of my buttons using set brush resource to texture.
In the widget2 i want to get the texture assigned to the buttons in widget1 and set the brush of the balt textuttons in widget2.
Doing this i get only the default value of buttons in widget1.
I think that the buttons lose references and his info (brush) passing from widget1 to widget2.
How can i fix this?

You created widget 1 inside of widget 2 which means the button brushes you’re pulling out would always be default settings. You would need to create widget 1, set all the brushes, then in widget 2 grab a reference to the created widget 1 with non default brush settings and then pull those values. How you get that reference to widget 1 from within widget 2 depends on where you created widget 1.

Thank you so much for your reply. I create widget1 inside widget1 as you can see in the next image.
How can i get the reference to widget1 from within widget2?

You can’t create a widget from within itself. It’s like asking someone to birth themselves…it just doesn’t work that way. You need to create the widget in a player character or level blueprint or some other BP you can then access and reference the created widget from. This won’t work.

So i have created the widget1 inside my Level Blueprint and filled my array of buttons (i also tryed to fill with ButtonStyle).But now how can i get my array from Level Blueprint to Widget2?

Where did you create widget 2? So the thing is, you need to create a trail from widget 1 to widget 2 for them to communicate. If widget 2 is created in the player character then you reference the player character from the level blueprint and then get widget 2 out of the player character for example.

Can you please provide me some screen? I also don’t have Player Character in my project. According with your first answer:

How can i get the reference of widget1 and in particular how can i get the array MyTexturesFromCardPosition?

Again, I need to know where you “create” widget 2. Widget 1 is in the level BP, ok, but I can’t give you a path to reference widget 2 if I don’t know what blueprint created widget 2. Widget 2 can’t create itself.

**Widget 1 is created in the Level BP correct?

** Widget 2 is created in some unknown place…???

**Widget 2 needs to reference Widget 1? Which means all the code has to reside in the level because I am not aware of any way to pull level variables/widgets down. It is annoyingly difficult to access things in the level from outside the level BP.

oh…I create all my widgets in the level BP. When i swipe on my phone I create the widgets depending on where i am at the moment and the direction where i swipe.

Then your problem is super simple…SUPER simple. Just right click on the output pin after you create each widget and say “promote to variable”. Then you have a reference of each widget. Once you have that plug the reference variable in to whatever you like including that missing pin you mentioned earlier and you’re golden!

Sorry for being boring…How can i get the references that i setted in Level BP?
I don’t find anything if right click and search refWiCardPosition.

They are in the left side panel like any other variable, drag out into the editor and release and click “get”

You are going to edit the brushed from the reference we just made not directly in the widget blueprint.

Omg this work! Thank you so much! Thank you for your patience!!!

No problem. Glad you got it working!

Hi again…I don’t know why but the reference with widget1 works well but the reference with widget2 doesn’t work at all. It says: Accessed None trying to read propriety RefWiMain (widget2).

So it seems the issue here is that you are trying to use the reference before it is created. That is usually why you get the “accessed none” error in situations like this. Take screen shots of where you create each widget and where this reference is stored as a variable. So your first image if you scroll over to the left so I can see all the widgets created and their execution outputs. What I am guessing by the glimpse of your widget creations on the left is that you are using a sequence and have execution pins from something earlier in the sequence needing a reference to something that isn’t created until a later sequence output pin is executed and that is why you get the error. But a full view of the level blueprint (multiple images) would be best.

Thank you again for your reply…
Sure that is all my Level BP…

I need to see a screen shot of what is above the last screen shot here. Where is that execution pin going from the Ref Wi Main…it goes straight up somewhere and that is prob where the issue is. Also what is to the right of cattura1.png where the widget is not working.

I fixed it… I have just saved the textures from Wi_main in a variable in my LevelBlueprint and run. Thank you so much again :slight_smile: