I have 1 widget that I use for 2 different purpose. 1 is used for passing weapon variables while the other one is used for passing armor variables. I believe the easiest way is to duplicate the widget and pass different variables from it but is there some way to do it with just 1 widget?
I think this is different from my case. Basically I have a mainmenu widget where I put other widget inside as sub widget of it. The one I circled are the same widget but I want to use it for different purpose. weaponslot_hud for searching item related to weapon while equipmentSlot_hud for searching item related to armor. This can be done by simply passing a type variable inside the widget but If I create a variable inside those widget, the value will be shared since they are basically 1 widget with different name. Hope this makes sense to you
So what exactly is stopping you from passing them variables?
the value will be shared since they are basically 1 widget with different name.
This is not true. They are instances of the same class. Each has their own variables. As in, they both have an int and a bool. But each variable can hold a different value.
Perhaps what you’re looking for is inheritance. A base class has some shared variables, and child classes can add their unique data on top. It works with widgets providing you do not alter their hierarchy.
Ok, I think I finally understand what you mean. Checking the instance editable made the variable show up on the widget details. This is exactly what I am looking for.