# How would i save a collectables data to array?

**URL:** <https://forums.unrealengine.com/t/how-would-i-save-a-collectables-data-to-array/491681>\
**Category:** FX\
**Tags:** collectables, unreal-engine, question\
**Created:** [December 7, 2021, 2:12am UTC](https://forums.unrealengine.com/t/how-would-i-save-a-collectables-data-to-array/491681 "2021-12-07T02:12:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ToxicCoffee115](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ToxicCoffee115](https://forums.unrealengine.com/u/ToxicCoffee115)\
**Post date:** [December 7, 2021, 2:12am UTC](https://forums.unrealengine.com/t/how-would-i-save-a-collectables-data-to-array/491681/1 "2021-12-07T02:12:43Z")

</div>

Hi So i was wondering if there was a way to add a name of a collectables when it is collected to an array so it wont spawn if the player does back to the card’s location?

 ![353650-needhelp.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/5/0/55074c4320be7eed48daee0527ed791895eb1d79.png)

also want to add it to my save data as well how would i go about do that too?

---

<div class="post-metadata">

**Author:** ![Chasetopher](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Chasetopher](https://forums.unrealengine.com/u/Chasetopher)\
**Post date:** [December 7, 2021, 2:55am UTC](https://forums.unrealengine.com/t/how-would-i-save-a-collectables-data-to-array/491681/2 "2021-12-07T02:55:13Z")

</div>

Try using a structure containing the 2 variables you setup, then create a new variable that is an array of that structure, and when collecting something check if the array contains any elements with matching names using a foreach loop. Then if it does you’ll “Set Array Elem” and if not, add the item to the array.

Research a bit more about structures if you get stuck, and let me know if you have any questions.
