Cast to between 2 Widget Blueprints when button was clicked ?

hey !

i got a widget Blueprint that is my “master item buy”
and an another widget Blueprint “Master item sell”

and my Main Widget Blueprint that is always on my screen in my game

i create a list of item by dragging my Master item buy in a scroll vertical box.


i want to, in my main widget, “create widget” master item sell ( in a other scroll box vertical ) when i click buy on a button of my master item buy

i only see tuts base on variables base on Character Blueprints.
Is there a way to send variable blueprint to other UMG Blueprint ?

the only way i found is to create your shared variable in a gamemode class or character or “else” class.
I cant cast to “widget blueprint” to a “widget blueprint”
I needed to cast my variable of my first UMG to the blueprint class GameMode of my project, and then take my second widget blueprint and cast the gamemode into it.

I wish that we could cast UMG to UMG…

Do you have a HUD blueprint that is set by your game mode? It is set in the same place as the player controller, default level, etc.

You can use your default HUD as a place to store all references to your widgets and control transition between them. You could do this anywhere really, but it makes sense to put it in the HUD class since you can call it from your widgets and you don’t have to clutter up your game mode with UI stuff.