The Concept
I am creating a relatively simple cloud spawning blueprint tool, and when I input an integer it spawns static mesh components a set distance apart. This is working already inside of my construction script.
I want the static meshes I am spawning (so they are components attached to a central parent), to bob up and down. The way I would figure I would do this is with a timeline node used to change the relative location values of the components.
The only way I can figure I can store these components and call them is with an array and a ForEachLoop, which is where I run into my problem…
Question/Problem:
Since a ForEachLoop runs instantaneously, it doesn’t update the timeline in a looping fashion- instead I can only seem to get it to update either the first or the last component in the array. How can I call to the spawned components, and set them to loop a simple up-down, lerping animation?
Attempts
I’ve tried running it on event tick, timeline updating for each loop, for each loop triggering a custom event, and just various attempts at variable changes. Nothing seems to work. I am figuring at this point that I may have to spawn blueprints inside of the “master” blueprint, and set the ForEachLoop (in the master) to trigger the timeline inside of the spawned components through a custom event. It just seems like that may be a less efficient and more expensive way to do this.
TL;DR
How can I spawn a random number of components and set each one of those components to loop an animation?
It goes without saying, that any help is much appreciated.