[C++] How to wait for variable change inside one UFUNCTION?

Hello!

I’m writing dialogue system, and I just stuck on waiting inside one function for something ( e.g. variable change)
Inside editor it looks like this:


I’m trying to do something like cin.getch (which is waiting for user input).

Question:

How to make function “wait” for something? I tried timers, but “Dialogue Option” does a few other things, so it can not be repeated. Something like multithreaded while(x = 2), which checks this value every frame.

You can’t. Blueprints are single threaded. You can add callbacks for doing things later or set things to tick (timelines, delay nodes, etc.) but a single node cannot block until something changes.

Actually you can do LatentAction function, like Stream Level, but I am not sure if it will be convenient to use it.

That looks very nice! I’ll definitely try to use it.