I’ve got a rather complex utility widget that takes about 20 seconds to complete while constructing, and it only needs to run once… on construct. But it runs every time a Level is loaded, so its a pain waiting for it all the time. Is there a way to stop it from reconstructing when a level loads? I don’t know why you’d ever want it to? Or perhaps there’s a different event other than construct that just runs once? ‘On initialize’ doesn’t seem to do anything.
I’ve tried On Run, On Pre-Construct and On Initialize and none of them actually run anything that follows it when the widget is launched, so I’m stuck using Construct which runs every time a Level is loaded. I don’t know why On Run and On Initialize don’t seem to work.
Update: I’ve managed to get On Initialize to work, but it still runs every time a level loads. But worse than that, I’ve tested it and all set variables are lost when a level is loaded, so I’d have to re run all the scripts anyway. Seems loading level destroys Widgets and rebuilds them again every time. Hopefully there’s a way around this? Or the devs are aware of it and making it persistent in future without the need to re-construct on level loading.
anybody got any ideas on this? As the construct script runs quite a lot of things and interacts with other APIs it takes about a minute to run, so I have to wait this long every time I switch levels in the editor.