Wait for latent nodes to finish before looping in Blueprint?
I need to use a loop to load a bunch of meshes and place them next to eachother, using each bounding box as a basis to determine where to place the next one. Well, it's hard to explain, but long story short, I found out that I needed to use the "Load Asset" node. The problem is that "Load Asset" is a latent node. Already there I had to move my entire bp function out into the EventGraph and replace any local variables for it to work.
But the problem now is that the loop fires each cycle before waiting for the latent node to finish, so I can't use the previous meshes bounding box as that latent node hasn't finished loading in the mesh yet.
How can I prevent my loop from starting the next cycle before the previous one has reached the end?
I tried creating a recursive function, so it would call itself at the end, and use a loop counter variable and a max limit variable. It did work... but only for a very small number of iterations. Anything above that tiny number gave me a "Infinite Loop detected" error and shut it all down (although I'm 100% certain there was no infinite loop). I can't just increase the limit in the project settings either, as it is a store asset, meant to be included in others projects.
So, I'm desperate for any other ideas! Thanks in advance!
asked Apr 05 '17 at 05:38 PM in Blueprint Scripting
I found a "solution" not long after posting the question.
It's so simple, I'm amazed it even worked...
Instead of a recursive event calling itself... just reroute the last exec pin to the beginning of the event.
Bam. No more infinite loop complaints!
answered Apr 05 '17 at 06:40 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here