Changing a class variable.

I made a post on this a few hours ago but it was very badly worded and quite confusing. What i wanted to know is, is there a way where i can change my variable from one thing to another let me explain a bit more.

Basically i want a umg widget button (there will be 3 buttons for all 3 of the guns) where the user can select between 3 guns says the three guns were called Ak47, Scar, P90
if the player select the 1st option(AK47) it would change my primary weapon blueprint from the default weapon (Scar) to the ak47
Then the default weapon would be the 1st option(AK47) and not the scar and this can be constantly changed so the player can keep switching between new guns


This is a classic case for inheritance. You want all of your guns be child blueprint classes from the same class. Called for example Gun. You implement everything these 3 guns have in common in that class: damage, accuracy, amount of ammo… and you change the respective values of those variables in the respective gun. Now you change the type of your weapon variable in your character to Gun. Now you can easily modify the weapon class your character currently helds during the game.

I already have all that set up all my guns inherit from a Weapon_Instant. The reason i have primary and secondary is because i have a switching system. i was wondering if the primary weapon blueprint and the secondary weapon blueprint can be changed from umg widgets so if i click a button on the UI the primary slot will change from “Weapon_Scar_BP” to “Weapon_AK47_BP” so that why you can change your current gun in the game without having to change it manually.

Is there a node for this in the Umg widgets to allow me to change a currently set blueprint variable

I dont know if im terrible at explaining but i mean but this should be 100% possible to do.

Basically i have a collection of guns. From a umg widget i want the player to be able to select their gun of choice…
This is the umg widget i mean


Ok so the user has a selection of three guns say the player wanted their primary gun to be a Scar if they click the Scar button it will set their variable in the character class to the correct blueprint
So if i clicked the Scar button it will set the primary gun to this


If the player wanted to change their primary gun to the KA5C if they click the KA5C Button it would again change the variable blueprint class from whatever their previous gun was in this case mine was the Scar to the KA5C like this


Then if the player wanted to change again they could select their gun they want and once again it would change the blueprint variable


How can i setup the buttons in the umg widget to change the blueprint variable automatically?

Any ideas? There must be a node to change this in umg widgets?

Also how do i get my gun model in a umg widget just the gun without a background?