Can i use same widget through menu level and game level?

Hi,
I am an amateur and i want to make a choice selection menu and deck selection menu (something like clash royal). I manage to do something like that (picture 1 and 2), but my question is :" How can I save images from a deck selected (which are 2d textures btw.) to spawn my object or mesh in a new level? or: Can I somehow when I’m in a new level see these images that I Drop on from the selected widget and spawn them in the game manually?" I saw some talented guy say: “This is user-independent and will mostly be found in GameMode, GameInstance, GameState and Player Controller.” (https://answers.unrealengine.com/questions/424894/view.html).
My gameinstance does not save selected images from the deck selection when i go in another level. In my GameInstance widget i use variable (2d texture) to save chosen images but I can t see them in another level. I am sorry for bad grammer and if it was dumb questions.

334049-2.jpg

Well, I am trying to save texture in gameinstance so yes, but i dont know did i call him or not, because i dont see him in another level.

I was searching tutorial on youtube, but only variable i saw are integer, name, string. This one guy manage to save image but didnt say how(https://answers.unrealengine.com/questions/915625/how-do-you-save-texture2d-images-to-game-instance.html)

Yes am using Blueprints and I change in setup my gameinstance with variable 2d texture. Do I need to put My gameinstance in choice selection menu widget or deck selection menu widget to call funktionality of saveing 2d texture?

Hi are you saving texture in gameinstance?

Assuming you are using Blueprints and Have setup your custom game instance in project settings.

Create and variable inside Texture2D in GameInstance blueprint. Make sure it’s public and editable

call GetGameInstance in your blueprint cast it to custom GameInstance and set your variable with your texture.

In Project settings → Maps and Modes-> Game Instance class
you should set your game instance class there

no need to put game instance. You can access game instance from anywhere using getgameinstance method. just make sure to cast it to your custom game instance to use it

Okej, i did that in In Project settings → Maps and Modes-> Game Instance class. Thats why i said i use in setup “mygameinstance”(this is my custom name for Game Instance class). Sorry if I didnt specified more clearly.

Variable needs to be Object type in GameInstance

[User Widget Code][2]

i don’t know how to say this in best way but i hope this is enough
THANK YOU :slight_smile: !!!

I don’t get it why?
I paste it in widget whose main assignment is choice selection menu.

You have created Texture Object as variable in Game Instance. Just change it to UObject Variable. Check my screen shot variable type is object

Yes, I change it to UObject Variable.

Still can’t connect them.

How did you made this “set node” who needs to be connected with gameinstance and break slateBrush?

Just drag node from Game Instance and type the name of variable