# is it possible to get access from c++ component to UI blueprint code without needing to make UI's blueprint code to c++ class?

**URL:** <https://forums.unrealengine.com/t/is-it-possible-to-get-access-from-c-component-to-ui-blueprint-code-without-needing-to-make-uis-blueprint-code-to-c-class/885793>\
**Category:** C++\
**Tags:** unreal-engine, CPP, question, Blueprint\
**Created:** [April 11, 2023, 1:16pm UTC](https://forums.unrealengine.com/t/is-it-possible-to-get-access-from-c-component-to-ui-blueprint-code-without-needing-to-make-uis-blueprint-code-to-c-class/885793 "2023-04-11T13:16:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![emir143](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@emir143](https://forums.unrealengine.com/u/emir143)\
**Post date:** [April 11, 2023, 1:16pm UTC](https://forums.unrealengine.com/t/is-it-possible-to-get-access-from-c-component-to-ui-blueprint-code-without-needing-to-make-uis-blueprint-code-to-c-class/885793/1 "2023-04-11T13:16:54Z")

</div>

im trying to work with c++ UI and make a inventory, but the thing is i have 3 UI’s trying to access each other and when im trying make UI’s access each other, it gives me error.

so: UI1 has to access UI2 and UI2 is need to access UI1 then UI 2 tryin to also access UI3  
by my understanding, it gives me error for that.

so im wondering, i can somehow access through a component c++ to UI blueprint without needing to move UI blueprint code to c++?

---

<div class="post-metadata">

**Author:** ![ScrewdriverHyena](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/screwdriverhyena/32/679006_2.png) [@ScrewdriverHyena](https://forums.unrealengine.com/u/ScrewdriverHyena)\
**Post date:** [April 11, 2023, 3:03pm UTC](https://forums.unrealengine.com/t/is-it-possible-to-get-access-from-c-component-to-ui-blueprint-code-without-needing-to-make-uis-blueprint-code-to-c-class/885793/2 "2023-04-11T15:03:17Z")

</div>

You don’t need to convert the whole thing to C++; however, you would need a C++ base class created with the properties you’re trying to store so that you can access them from your blueprints.

---

<div class="post-metadata">

**Author:** ![emir143](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@emir143](https://forums.unrealengine.com/u/emir143)\
**Post date:** [April 11, 2023, 3:18pm UTC](https://forums.unrealengine.com/t/is-it-possible-to-get-access-from-c-component-to-ui-blueprint-code-without-needing-to-make-uis-blueprint-code-to-c-class/885793/3 "2023-04-11T15:18:59Z")

</div>

so if i get this straight, if i make a c++ component with the variable’s that is assigned/defined as the UI’s  
so like:

var1 = UI1  
var2 = UI2  
var3 = UI3

then i can just code the logic in c++ component and it would be fine?  
or for better understanding for both me and you

if i put either ‘inventory key function’ code only to the component or put all the red marked code / variable to c++ code into a c++ component class then add it to my character.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/f/d/dfd9e4f1b4518b82e0bb2f33bd8ed9d838af75aa.png)

is it possible for the inventory to still function like normal?  
sorry if its obious/dumb question im asking, im very new to unreal c++
