how can i expose variable to create widget

hi
so i have made a inventory in blueprint as an assignment, and im trying to move it to c++, but the problem i have is that in one of the UI’s blueprint code, im using a create widget and i have referenced another UI widget class, so when i have done that, it exposes one of the variables that i have in that UI blueprint class

my question is, how can i expose one of the variable in create widget()?

for better understanding: i want to recreate this
image
the create widget under, is an example to see the difference.
how can i add the parent variable to Create widget() in c++?

hi @emir143

in the details panel of the variable tick expose on spawn

i have already done that but how can i implement it on c++ CreateWidget() like in blueprint?

hmm have a look at what this guy says

im guessing as soon as you create the widget you set its variables from that object

so if i understand correctly, i shouldnt write it inside of the CreateWidget() but instead under/after it. so it do be like as if im reassigning the variable?

yeah judging by that im guessing so which would make sense in usual c++, guessing the blueprint expose is to optimise the amount of nodes in BP only so dont have to do another call to the BP

i see now, thank you for your answering and time :slight_smile:

1 Like

no problemo, please mark the as resolved so that others can benefit if they find this :slight_smile:

1 Like