When I said I have set positions, I should of said that the widget could be spawned in any of the 5 locations depending on how many others are spawned.
So if only No 5 has stock, then it will spawn in position 1, but if No 3 and No 5 have stock, then No 3 would spawn in position 1 and No 5 would spawn in position 2.
Here is my idea : You set your different stocks (which was not obvious at start as you shown one only) in an array, loop it and when different to 0 you spawn with transform array :
Edit : Don’t forget to reset currentLoc on completed !
Edit 2 Another idea is to use your “number of stock” value as start value for currentLoc or as value to spawn if you don’t want do the array. But with array you no more need to set this variable.
I didn’t try with umg. But in level, if arrays are arranged in the same way, you’ll have the same result and will can spawn each correct element at the right place, but in the same loop body line, or you’ll have to do one check for each type of spawn. (you can do a function too, but you’ll have to add eventual transform modification as input)
Just did a try with a blueprint with a widget in, it works. Check the scene outliner, to see where they are in your level and then check your transform ( rotation scale).
Edit : I modified my widget bp to modify widget easily by adding a box as root.