setting visibility of a widget from another widgets button?

so basically i just need to set up another branch to check for visibility is what your saying. and i dont see how im making 2 instances of the same widget when the inventory widget is only created once. there is no 2nd create widget. not to mention the hud and inventory panel are all part of the same widget so thet would mean i would be creating the hud 2 times but im not. thats why i have it set up the way i do exactly the same since the widget it self is only created 1 time and im only setting a vertical box inside that widget visible or hidden. so from all of this can you tell me how im creating 2 instances if the widget it self is only created one time?

also my blueprint works fine this is and addition im doing with adding in the button this was not part of the tutorial and ive made many buttons before and never had this issues

dont get me wrong i do appreciate the help.

It wouldn’t wipe them. You need to have an array with all the items in your character blueprint, so everytime the widget is called, it updates what each slot of your menu has. And yes, going from map to map is going to reset your widget anyways (at least as far as I know), so you better keep a track of what’s in that menu. If that menu shows the skills you have currently equipped, you want to access your main character’s array of equipped skills and display them in the menu you create.

I don’t know if I’m explaining myself properly.

np, and believe it or not, I’m really trying to help. :slight_smile:

I hope I’m not confusing you more but what I’m trying to put across is you are calling it twice so guess what -> it shows it twice
that flip flop is getting cut on when you press &/or click then you are expecting the other to cut it back off & that’s not how it works. (so you have two widgets showing from the same one you first created via the objects you keep calling.) but to keep it simple just ignore what’s in the parenthesis for the moment. you are flipping those flip flops and now they are stuck waiting on you to flop them back off again, hope that makes sense. (ie: you cut them on now they are waiting on you to cut them off before they do anything else)

if you insist on using the key command & the click, then they have to know what the other is doing, use a control variable of some type ( probably a Boolean is best) that both BPs know about and can access, probably best to do this from your character BP (Sora I’m guessing it is)
ie: I am open (whether it’s a click or a key event) and I’ll close when you hit the event again (either click or key) but that event needs to know that the widget is already in use so it can close it, just like it needs to know if it’s not showing to start with so it can open it.

Edit for clarity: if you do try to use both key & click events, separate the A & B parts and use the control’s True & False to open & close your inventory

Another possible & maybe even cleaner approach (worth trying):
is to use the clicked event in widget to call that original call_Inventory event (or you may have to create a new event) in your Sora BP :slight_smile:
(in widget: get player character -> cast to Sora (BP) pull off of blue pin & access the event in Sora)
(from the little I can see in your screenshot you should be able to plug both events into the branch)

don’t forget you can always use a PrintString to see if these things are working or not & how /when they are working as well. don’t be scared to use them, easy way to see where your flow is going and even if it’s working.

ok so after a large amount of testing and talking with another blueprint scripter we came to the conclusion that ue4 is broke. but really not the case. so to clear things up so people can simplfy there stuff with out all the extra hard ships. you can infact make a simple set up like i have with just the set visible nodes if your trying to hide /show a menu they will work in conjunction with other key binds seeing how the set visible node actually does all the checking you need as long as you give it a target. with that being said if you want to do less nodes doing a visibility bind can be used just to cut 1 extra node out on the widget it self…

now for what the actual cause of the issues with the menus and why its duplicating. the duplication is caused by basically switching levels. for my testing i was going from the mainmenu to the new level which in turn recreates the widget 2 times. this is because the create widget is in the character blueprint as the ue4 tutorial said to do. which is fine its still doable. so in order to fix this issue you have to do the following…

if your using the ue4 tuts on inventory system you can do as he says and create your widget and add it to viewport in your character blueprint. i also found that this is the only way to receive and key inputs on it. no idea why and trust me i tried every thing.

so first if you have a main menu that opens a new level then to avoid the duplicate menus on your inventory you have to just remove it from parent. so from the new game button or what ever you called it just cast to your player grab the inventory variable in your character blueprint and just plug it in to the target on remove from parent. other wise you will end up with duplicate widgets. so for each new level you have to go to you will have to do the same process each time. I believe you will need to auto save your variables before you load a level and load them when you open the level in order to not lose any information in your arrays i have not tested this yet but will when im done with the rest of the inventory system.

once again thanks again for all who posted tips and such! :smiley:

glad you got this working for you & fixed

but in all that information, you left out the fact that you were changing levels. (or I am blind as a bat)
either way, this should have been the first thing you mentioned not the last, just in case you ever have any future problems.

again, glad you got it working, again, it looks great, and good luck

in all honesty it didnt really hit me till about 11 last night that the level switching might be the problem but was to tired to test so tested it this morning and that was the case and i did mention switching levels when i asked keytotruth a question ( “yeah but wouldnt that wipe my inventory of all its items? cause i was thinking the same thing but i was afraid it would wipe my items all together. and at this point i already have the widget set up to have everything go through one widget. meaning no child widgets except my slots. also the widget it self gets created once. unless switching between levels would cause teh same effect if i am creating the widget in the character blueprint” ) But even then it really didnt hit me to try removing it from viewport. Its one of those stupid things that kinda just fly over your head while your ripping your hair out over something slapping you in the face going im right here you idiot remove me! :smiley: