hubs
hubs copied to clipboard
ForLoop flow node does not behave as expected.
Description
When using a ForLoop
flow node, the output doesn't appear to fire the correct number of times as specified in the startIndex
/endIndex
values of the node.
To Reproduce
Steps to reproduce the behavior:
- Open the included .blend
- Note the Behavior Graph setup.
- Export as .glb
- Run in Hubs and click on the icosphere
- Note that the debug message immediately says
Completed Loop
followed by9
.
Expected behavior
Based on the graph, upon clicking the icosphere, the debug should print 1 2 3 4 5 6 7 8 9 10
with a half second delay between each digit, followed by a debug message saying Completed Loop
.
Screenshots
Hardware
- Device: Desktop
- OS: Windows
- Browser: Chrome
Additional context The example is the same setup as described by Unreal Engine's blueprint node, ForLoop. https://docs.unrealengine.com/4.26/Images/ProgrammingAndScripting/Blueprints/UserGuide/FlowControl/ForLoop_Network.webp ForLoop.zip
The problem here is that the way the delay node is design, it doesn't enqueue operations and if there is a pending operation it ignores the next one. As the for calls delay instantly for every number in the sequence, the delay node only executes the first one. for what I see the Unread node doesn't use delay so it's not exactly the same case.
What is the use case for this? maybe it's something that can be done it some other way?
In our meeting today, we discovered that using a Throttle
node might be the solution to this issue, but we'll have to test it.