Loop through TArray of a struct

You are creating copies when you do that.
You should only loop by value when it’s primitive types like int, float, size_t;

For compound types use immutable labels:

for (const FInventoryItem &Item : InputArray) {
2 Likes