I could use some help, i have an array (AllClothingItems) that is being populated properly in it’s function (SpawnRandomClothing)It spawns random combinations meshes+materials. This happens in BP_Clothingrack.
Then a second function inside the PlayerBP should pick 3 of the spawned pieces and populate the RequiredClothingItems array to set things up further. The array is populated properly, but the GET (a copy) node that starts the logic to check for duplicates and then add it to the RequiredClothingItems array does not get populated.
the functions are connected and running on EventBeginPlay properly.
Are you sure AllClothingItems is being populated. When you print the length of the array after SpawnRandomClothing, is it non-zero?
Also, I see that almost all of your casting nodes have a blue NOTE at the bottom. I believe this is due to the fact that the cast is redundant as the object is already the desired type. You can safely remove those if that’s the case.
I think I see your problem now. You’re never actually populating RequiredClothingItems in the first place. You’re only populating inside the for each loop but what if you don’t have any items in the array yet? You will never add anything.
EDIT: Instead of populating in the for each loop you could simply set a boolean variable indicating whether or not you found the clothing item. Then off of the complete node you check the boolean. If you didn’t then add it to the array.
First you clear required clothing items and than you try to start a loop from the same empty array.
Also, there is no exe line from completed on any of the loops.