# Inventory UI With UMG

**URL:** <https://forums.unrealengine.com/t/inventory-ui-with-umg/483643>\
**Category:** UI\
**Tags:** add-variable, inventory-system, unreal-engine, UI, question, UMG\
**Created:** [May 19, 2021, 10:13pm UTC](https://forums.unrealengine.com/t/inventory-ui-with-umg/483643 "2021-05-19T22:13:53Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![BabyYoda35098](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BabyYoda35098](https://forums.unrealengine.com/u/BabyYoda35098)\
**Post date:** [May 19, 2021, 10:13pm UTC](https://forums.unrealengine.com/t/inventory-ui-with-umg/483643/1 "2021-05-19T22:13:53Z")

</div>

I am using the “Inventory UI with UMG” and I have a problem with my CanPickup actor, I made a variable called “Item Amount” that holds the amount of CanPickups I have, but the probelm is each CanPickup has a different “Item Amount” meaning,  
if I have two in the level and pickup one it adds one to A’s “Item Amount” but when I pickup another one it adds it to B’s “Item Amount” Instead of A’s “Item Amount”

---

<div class="post-metadata">

**Author:** ![CamJam246](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CamJam246](https://forums.unrealengine.com/u/CamJam246)\
**Post date:** [May 19, 2021, 11:37pm UTC](https://forums.unrealengine.com/t/inventory-ui-with-umg/483643/2 "2021-05-19T23:37:56Z")

</div>

Can you post screenshots of your code?

---

<div class="post-metadata">

**Author:** ![BabyYoda35098](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BabyYoda35098](https://forums.unrealengine.com/u/BabyYoda35098)\
**Post date:** [May 20, 2021, 5:04pm UTC](https://forums.unrealengine.com/t/inventory-ui-with-umg/483643/3 "2021-05-20T17:04:43Z")

</div>

![339367-ue4-problem-picture-1.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/a/6/ea661fd9254dc141b87d413396d0efb68413bc40.png)

---

<div class="post-metadata">

**Author:** ![BabyYoda35098](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BabyYoda35098](https://forums.unrealengine.com/u/BabyYoda35098)\
**Post date:** [May 20, 2021, 5:06pm UTC](https://forums.unrealengine.com/t/inventory-ui-with-umg/483643/4 "2021-05-20T17:06:44Z")

</div>

![339374-ue4-problem-picture-2.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/f/d/0fd64f23e4aa6c166a41e0d6df9bc40172de5dc6.jpeg)

---

<div class="post-metadata">

**Author:** ![BabyYoda35098](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BabyYoda35098](https://forums.unrealengine.com/u/BabyYoda35098)\
**Post date:** [May 20, 2021, 5:07pm UTC](https://forums.unrealengine.com/t/inventory-ui-with-umg/483643/5 "2021-05-20T17:07:42Z")

</div>

![339375-ue4-problem-picture-3.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/f/3/df37bf15aff8881475cc5690b9a6a8a19cb9e8f2.jpeg)

---

<div class="post-metadata">

**Author:** ![BabyYoda35098](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BabyYoda35098](https://forums.unrealengine.com/u/BabyYoda35098)\
**Post date:** [May 20, 2021, 5:07pm UTC](https://forums.unrealengine.com/t/inventory-ui-with-umg/483643/6 "2021-05-20T17:07:55Z")

</div>

![339376-ue4-problem-picture-4.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/f/1/df134433bc6c7f6f1c3b7b11686256d942346aab.jpeg)

---

<div class="post-metadata">

**Author:** ![BabyYoda35098](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BabyYoda35098](https://forums.unrealengine.com/u/BabyYoda35098)\
**Post date:** [May 20, 2021, 5:08pm UTC](https://forums.unrealengine.com/t/inventory-ui-with-umg/483643/7 "2021-05-20T17:08:08Z")

</div>

![339377-ue4-problem-picture-5.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/3/5/e3557c0114a05d204db14f6eff58eafdb46b6e31.jpeg)

---

<div class="post-metadata">

**Author:** ![BabyYoda35098](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BabyYoda35098](https://forums.unrealengine.com/u/BabyYoda35098)\
**Post date:** [May 20, 2021, 5:08pm UTC](https://forums.unrealengine.com/t/inventory-ui-with-umg/483643/8 "2021-05-20T17:08:25Z")

</div>

![339378-ue4-problem-picture-6.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/b/71b0f4a87262dcc8a5e7ba264dd4c137b58e7578.jpeg)

---

<div class="post-metadata">

**Author:** ![notrealvitor](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/notrealvitor/32/731461_2.png) [@notrealvitor](https://forums.unrealengine.com/u/notrealvitor)\
**Post date:** [May 20, 2021, 10:21pm UTC](https://forums.unrealengine.com/t/inventory-ui-with-umg/483643/9 "2021-05-20T22:21:33Z")

</div>

Hello!  
If I understand right the ItemAmount variable is located inside the CanPickUp actor right? In this case, since you have multiple actors, each of them have a independent ItemAmount of their own. To have both CanPickUp actors affec the same variable, the variable should stored inside your PlayerController or in your PlayerPawn, then you can access it by adding a CastTo node to your Player or PlayerController depending on where you stored the variable, thru the CastTo node you will be able to acess the variable to Get or Set the ItemAmount variable store in the Player as you want.

Here’s an example of the cast node.

 ![339312-screenshot-2.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/c/e/dce54e9736d5f49c31ed12a40ab78795b00040c7.png)

---

<div class="post-metadata">

**Author:** ![BabyYoda35098](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BabyYoda35098](https://forums.unrealengine.com/u/BabyYoda35098)\
**Post date:** [May 21, 2021, 3:33pm UTC](https://forums.unrealengine.com/t/inventory-ui-with-umg/483643/10 "2021-05-21T15:33:23Z")

</div>

I have tried that and it works but then all of my items will be the same amount, example when I pick up 3 cans it will show that I have 3 cans, but I will also Have three wood and I only picked up one wood,  
I need the “Item Amount” to be used for many items, but thanks anyways
