hubs icon indicating copy to clipboard operation
hubs copied to clipboard

ForLoop flow node does not behave as expected.

Open j-conrad opened this issue 1 year ago • 2 comments

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:

  1. Open the included .blend
  2. Note the Behavior Graph setup.
  3. Export as .glb
  4. Run in Hubs and click on the icosphere
  5. Note that the debug message immediately says Completed Loop followed by 9.

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 image

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

j-conrad avatar Sep 19 '23 08:09 j-conrad

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?

keianhzo avatar Sep 19 '23 10:09 keianhzo

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.

j-conrad avatar Nov 06 '23 19:11 j-conrad