Hi I’m wondering if there’s any way to get the number of loop iterations of a PCG loop and/or sum the value of attributes in an array. For example I’m trying to do something like this pseudocode:
weights = Array of float values
sum = sum of the values in weights
normalizedWeights = new array
for each weight in weights {
– normalizedWeights[i] = wights[i] / sum
}
return normalizedWeights
or even just
meshes = array of arrays of meshes
for each array in meshes {
– max = (index + 1) * (1 / numberOfItterations)
– min = (index) * (1 / numberOfItterations)
– spawn all meshes in array when density is between min and max
}
Is anything like these possible in unreal pcg? It seems like there should be but I can’t seem to make it work. I’m pretty sure I’m missing something here so i would love some help!