x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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?

alt text alt text

Product Version: UE 4.19
Tags:
widget1.png (174.5 kB)
widget2.png (343.9 kB)
more ▼

asked May 15 '18 at 08:31 PM in Blueprint Scripting

avatar image

pitta
3 1 5

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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.

more ▼

answered May 16 '18 at 01:50 AM

avatar image

Nebula Games Inc
2.5k 13 8 8

avatar image pitta May 16 '18 at 09:29 AM

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? alt text

widget1.png (213.1 kB)
avatar image Nebula Games Inc May 16 '18 at 01:43 PM

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.

avatar image pitta May 16 '18 at 03:52 PM

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?

avatar image Nebula Games Inc May 16 '18 at 04:05 PM

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.

avatar image pitta May 16 '18 at 04:49 PM

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

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

widget1.png (561.0 kB)
widget2.png (487.1 kB)
avatar image Nebula Games Inc May 16 '18 at 04:53 PM

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.

avatar image pitta May 16 '18 at 04:59 PM

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. alt text

levelbp.png (353.8 kB)
avatar image Nebula Games Inc May 16 '18 at 05:09 PM

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!

avatar image pitta May 16 '18 at 05:25 PM

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. alt text alt text

wi2.png (356.8 kB)
lbp.png (454.6 kB)
avatar image Nebula Games Inc May 16 '18 at 05:37 PM

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

avatar image Nebula Games Inc May 16 '18 at 05:38 PM

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

avatar image pitta May 16 '18 at 05:50 PM

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

avatar image Nebula Games Inc May 16 '18 at 06:44 PM

No problem. Glad you got it working!

avatar image pitta May 18 '18 at 07:57 PM

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). alt text alt text

cattura.png (334.2 kB)
cattura1.png (385.1 kB)
avatar image Nebula Games Inc May 21 '18 at 10:03 PM

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.

avatar image pitta May 21 '18 at 10:55 PM

Thank you again for your reply.. Sure that is all my Level BP.. alt text alt text alt text

1.png (262.9 kB)
2.png (277.8 kB)
3.png (354.9 kB)
avatar image Nebula Games Inc May 22 '18 at 02:07 PM

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.

avatar image pitta May 22 '18 at 02:52 PM

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 :)

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question