If I understand correctly, custom events run asynchronously, whereas functions do not.
So if I call a custom event, then from within that call a function, does the function run on the same thread as the custom event, or does it run on the main game thread?
If I google âue4 events vs functionsâ what comes up is â Events cannot have return values or local variables like the Functions but the key difference is that they are asynchronous by nature, this means a couple of things: You can manipulate time inside events (e.g., delays or timelines) You can replicate them over network, essential for any multiplayer game.â
Iâve read in several places that events are asynchronous, so it is surprising that you say they are not
I tested it using a long for loop after a delay node: it freezes the game (i.e. the main thread); asynchronous functions do not freeze the game. Events can call latent/asynchronous functions, but events themselves are not asynchronous. A latent function simply pauses the execution of the event until the function is complete.
If events were asynchronous, they wouldnât be useful for gameplay code because the time they would complete would be random.
This seems to be entirely what the source means by asynchronous. It just means nodes in the event graph can pause and keep executing in frames where they arenât explicitly called by other game code. It has nothing to do with concurrent execution of multi-threading. The Blueprint VM runs only in the game thread.