Why is the if statement failed? C++

Just a comment: Instead of iterating the array to find an item and adding it, if it is not present already, you can also use the AddUnique function of (T)Array.
This only adds the item, if it is not yet present and returns its index, and in case it is already there, it returns index_none.
I believe, this can make your life much easier, both, in bp as well as the c++ function.

And, as to the out of range - the root cause of this is most likely hidden somewhere in your RandomItemType function. Need to have a look at this, I found, that you did post this one and that the out of bound is gone…

What’s in the RandomItemNumber C++ function (Random Number Item in BP) ? Is it just a random int in range?

1 Like