Warner_V
(Warner)
October 11, 2024, 1:18pm
1
As per the title, I’m trying to build a simple “For Each Loop With Delay” BP macro, since it would be useful in many places.
However, it keeps on going into infinite loop and I can’t figure out why.
Here’s the current design, based on the original “For Each Loop”: For Each With Delay posted by anonymous | blueprintUE | PasteBin For Unreal Engine
Any ideas?
Sitiana
(Sitiana)
October 11, 2024, 1:33pm
2
Hello, the macro itself looks good for me. From the fact that your Delay requires World Context Object I assume that you do this in Object MacroLibrary or a Macro inside an UObject. I don’t think delays will work in UObjects.
Maybe try to do such macro in Actor MacroLibrary (and UserWidget MacroLibrary if you need it for widgets as well). Then it should work fine.
Warner_V
(Warner)
October 11, 2024, 1:40pm
3
Okay, thank you…
This implementation is for UMG, it’s in a Blueprint Macro Library with UMG.Widget as parent. Any workarounds you can think of?
Sitiana
(Sitiana)
October 11, 2024, 1:42pm
4
Ok but all Blueprint widgets inherits from UserWidget anyway. Maybe try to make this Macro Library for UserWidgets instead of Widgets?
EDIT: I’ve done the same macro for some projects, I will send it in about 20 minutes when I’m back home.
Warner_V
(Warner)
October 11, 2024, 1:50pm
5
Sitiana:
dget anyway. Maybe try to make this Macro Library for UserWidgets instead of Widgets?
EDIT: I’we done the same macro for some projects, I will send it in about 20 minutes when I’m back home.
I can’t reparent to UserWidget. But UMG.WidgetComponent seems to work. → Correction. Needed to copy-paste the function to a new library.
Warner_V
(Warner)
October 11, 2024, 1:59pm
6
So with UserWidgets as parent the ‘World Context Object’ is no longer required as you said:
…but the finite loop still occurs unchanged.
Sitiana
(Sitiana)
October 11, 2024, 2:06pm
7
This is mine, without that initial delay parameter, you could try if it works in your case. It works for me as expected.
system
(system)
Closed
November 10, 2024, 2:06pm
8
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.