Help with very simple level stream function, can't exit simulation without freeze until force close

I have a simple function that is two for loops hooked up too each other. The for loops are supposed to be creating instances of a few different levels that would then be streamed in.

It uses some of the most simple math in existence to determine the next location.

The blueprint functionality is setup in the persistent levels, level blueprint. All the variables are editable and public. The sub levels are attached to the persistent one, set to load from blueprint. Their names are in the array and spelled correctly.

The for loop only will only complete once most of the time, occasionally it will complete two times. I did have a completely random number to use as a level’s “unique instance name” and that fired and spawned every level properly, but only once. I was never able to reproduce it.

So something about the levels unique instance name seems to be the culprit? But it shouldn’t ever be a problem due to how it is being set in my function??? Am I misunderstanding how order of operations works in blueprint nodes?

Testing this is incredibly hard and frustrating as every time I exit the simulation ue will freeze until I force close it with task manager, as an experiment one time I went and made dinner then came back and it was still frozen.

Seriously any help appreciated, my project is dead until I can solve this.

Did not test your function, but when you get the length of your array and then the RandomIntegerInRange there will be an error because Length=/=LastIndex:
Length : 1,2,3,4,5,6
MaxArrayIndex: 0,1,2,3,4,5
So you should use Length-1 or LastIndex

1 Like

Thank you, after waking up this morning I noticed that and corrected it but no dice.

I then had a random thought if the unique name appears to be the problem… Then it needs further testing. It turns out “Unique Instance Name” cannot accept anything other then 0-9 numbers.

If I only use numbers it works. If I append anything other then a number it will result in a freeze or the level just not spawning.

This is an odd oversight and definitely has to not be intended behavior, hopefully Epic knows about this and can move on it.

Thank you for your help man! Appreciate it!