Hello, Im experiencing an issue where a function takes in an array and returns a modified version of it and stores it back into the array it took in. For some reason this is not allowed, I was wondering if anyone knows why, what im doing wrong, and how to fix this?
The error I get is an assertion failed:
Attempting to use a container element which already comes from the container being modified.
Here is the part of code that does not work:
TArray<FAssetData> FilteredAssetData = GetAllObjectLibraryData(); FilteredAssetData = FilterByTag(FilteredAssetData);
I have tried creating a temporary array that FilterByTag stores its output into then assign the temp array to the FilteredAssetData array but still get the same issue.
I have also tried to store the FilterByTag output to a temp array, empty the FilteredAssetData array, loop through the temp array and add every item in the temp array to the FilteredAssetData array.
I need to do this because the FilteredAssetData array needs to be updated because it will then go through a second and third different filter to get to the final result of all filters applied to the FilteredAssetData.