Comparing two arrays of different types

Hello guys, I am trying to make a save system for my game but I am having trouble with something. I followed a tutorial to make the initial save and load system. How it works is once an item in the world is picked up (destroyed) it is added to a array of “ActorsDestroyed”. Then, whenever an Item is dropped into the world (added), it is added to the array of “ActorsAdded”. However, I am having this issue that after dropping the item a second time and reloading the game to see if it saved, it does not respawn. I believe this is happening because the first time when it is picked up it is added to the array of “ActorsDestroyed” and when I try to drop it for a second time, it still destroys the actor as its still in the “ActorsDestroyed” array. What I was trying to do is compare the two arrays and if array “ActorsAdded” had an item in “ActorsDestroyed”, it would remove the item from “ActorsDestroyed” so it wouldn’t be destoryed. However, the two arrays are of different type, one being an Actor soft class reference and the other a Actor soft object reference. I was wondering if anyone knows how to convert one array to the other or if they have another solution for my issue.

The images show what I tried to do, but it gets caught in an infinite loop

That seems a little inefficient to have those nested loops. Would it not be simpler to store your “picked up” state in a struct with your transforms and just not spawn the actor in the first place if it’s set as having been picked up?

Looks like you have a recursive definition of Get Object Class, which can explain the inifinte loop (it only calls itself, never reaching the return node).

But it may be simpler to avoid this issue altogether by rethinkning how you handle being picked up or not, like suggested above