# Blueprint Components

**URL:** <https://forums.unrealengine.com/t/blueprint-components/629729>\
**Category:** Pусский (Russian)\
**Tags:** unreal-engine, UE5-0, question\
**Created:** [August 16, 2022, 6:52pm UTC](https://forums.unrealengine.com/t/blueprint-components/629729 "2022-08-16T18:52:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![persanah](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@persanah](https://forums.unrealengine.com/u/persanah)\
**Post date:** [August 16, 2022, 6:52pm UTC](https://forums.unrealengine.com/t/blueprint-components/629729/1 "2022-08-16T18:52:08Z")

</div>

Hello. I’m making a spatial inventory similar to DayZ. I sketched out a small system of equipment and the inventory itself. Now I want to establish cooperation. The items being lifted are now in the form of an Actor, when they get into the inventory - the Actor is removed and I get an Object. On an item that can give its inventory (backpack, pants, jacket) there is an inventory component from where I get the data. Which I then use for interaction. Everything works until I activate the removal of the Actor after lifting the item. Because the variable I’m trying to write the component to contains only a reference, and when the Actor is deleted, the reference is invalid. If the Actor is not deleted, then everything works as intended. But I don’t want to save or move this Actor. What should I do? How can I interact with the component? Overwrite, change parameters? How can I save it, for example, in Object, so that later, when I throw the item out of the inventory, everything is preserved, or so that I can access the inventory avoiding spawn of the item?  
It works

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/7/d/77d5c97b77c94108cdf7562b2f6de171fbfed6df.jpeg)  
It doesn’t works  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/b/9/6b91b778611f974de897b63a5a2917413b4b96b0.jpeg)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/0/a/d0a640fb38f510b6a8b2689e65e4db35d3eff392.png)

---

<div class="post-metadata">

**Author:** ![dorusoftware](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@dorusoftware](https://forums.unrealengine.com/u/dorusoftware)\
**Post date:** [August 16, 2022, 9:37pm UTC](https://forums.unrealengine.com/t/blueprint-components/629729/2 "2022-08-16T21:37:02Z")

</div>

I don’t understand. What you want to do? Get an item from the ground and place it in the inventory and then throw it back on the ground?

---

<div class="post-metadata">

**Author:** ![persanah](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@persanah](https://forums.unrealengine.com/u/persanah)\
**Post date:** [August 17, 2022, 5:44pm UTC](https://forums.unrealengine.com/t/blueprint-components/629729/3 "2022-08-17T17:44:58Z")

</div>

The mechanics of selection and ejection are there. I have added an inventory component to some items (jacket, backpack) so that it has additional inventory. But a component exists only when there is an actor to which it is attached. How do I save or transfer this component, or do I have to do something else?

---

<div class="post-metadata">

**Author:** ![a1ex3d1983](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@a1ex3d1983](https://forums.unrealengine.com/u/a1ex3d1983)\
**Post date:** [August 23, 2022, 7:44pm UTC](https://forums.unrealengine.com/t/blueprint-components/629729/4 "2022-08-23T19:44:59Z")

</div>

Первое, что приходит в голову, не удалять Актора вещи, а парентить её к персонажу и прятать визуальный меш. Ведь по идее Вы таскаете её с собой. Надо подумать еще.  
Второе - создать такой же BP компонент на персонаже и перенести данные.

---

<div class="post-metadata">

**Author:** ![Rumzie](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Rumzie](https://forums.unrealengine.com/u/Rumzie)\
**Post date:** [August 23, 2022, 7:58pm UTC](https://forums.unrealengine.com/t/blueprint-components/629729/5 "2022-08-23T19:58:32Z")

</div>

This really isn’t a sustainable solution, but it will get the job done.

Just have an invisible actor in the world called InventoyComponentContainer or something. Then before your actor is destroyed just attach the inventory components to the Container.

---

<div class="post-metadata">

**Author:** ![persanah](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@persanah](https://forums.unrealengine.com/u/persanah)\
**Post date:** [August 23, 2022, 8:49pm UTC](https://forums.unrealengine.com/t/blueprint-components/629729/6 "2022-08-23T20:49:32Z")

</div>

Кажется я нашел путь к разгадке. Я просто сохраняю сам массив данных из инвентаря в персонаже. Если надеть эту куртку - в любом случае на персонаже создается эктор и в него я уже передаю массив, а потом вывожу результат. Единственное, пока не получится открыть контейнер внутри контейнера, но возможно это не очень реалистично и в том же Дейз для того что бы посмотреть содержимое, ты должен взять это в руки, то есть по сути также заспавнить новый эктор в руках. Так что кажется вопрос решен, осталось все это привести в нормальный вид, пофиксить баги и продолжать улучшения.
