[FEATURE REQUEST] Allow latent nodes in Blueprint functions

It would be great if Blueprint functions supported latent nodes. Like Unity’s Coroutines, being able to script something to happen over time in a reusable fashion with full access to the private variables of an actor and the ability to override in derived classes is quite useful.

Macros would almost suffice if they could be inherited and overridden by derived classes and called externally, but I don’t think that is supported. If that was supported this would not be necessary.

My use case:

I’m currently trying to use Blueprint to script conversation cutscenes in an RPG. The workaround I have at the moment involves macro libraries with a clunky extra “implementation actor” parameter passed to each macro. The Implementation Actor has functions to start a latent function, poll for whether it is finished, and finish it. The macro calls the start, polls, and then calls finished before returning execution to the macro caller.

So while I have a workaround, it forces me to use macros (which are inlined?) and to add an extra input to every macro, cluttering up my blueprint.

Hello there,

I have spent a lot of time learning UE4 as well and I’m stuck on the same problem as yours: trying to build up a generic easy-to-setup & easy-to-reuse Blueprintable conversation system for an adventure-style game. But it’s really pain-in-the-■■■ not having the ability to use some kind of latent node inside function, not being able to call a Blueprint macro from outside this blueprint (Standards Macro inherited blueprints blocks latent node as well) or even some kind of callback function parameters. UE4 is an amazing tool but the lack of modern development approaches - like lambda expression or async function - is really penalizing.

Any progress on those points since 2014?

Thanks for your feedback.

Latent nodes don’t work in function due to technical limitations, thread session in the function together with local memory containing local varables data get destroyed right after function is executed,

Delay puts on timer (it kind of diffrent timer then timer it self) and finishes execution of current line of action, effectively finishing up the function it self. When delay node timer finish countdown and tries to continue line of actions in function function environment from when delay node was activated is already permanently deleted and can not be restored and that state could cause uncontrolled behavior or crash. Thats why those nodes are banned from function. The same issue you will find in C++ (which don’t have delay to begin, only timers).

So sorry to say but macros and function name timers are best option posible here, my recommandation is to forget about delay node exstance (again C++ prgramers dont even have access to such feature) so you know how to deal with that. Also note that event is technically same as a function so using event with a macro is as much as effcient.

Thanks for your feedback. I found a way to implement the awaited features using Custom Events and some C++ customization. The result is surprisingly pleasantly to use inside BP, it made me forget about my async lambda expressions (almost :slight_smile: