What is the difference between SetTimerByEvent and UBlueprintAsyncActionBase implementation principle?

:grimacing: :grimacing:

A timer sets a number of seconds to call a given event in (and set timer by event specifies that any other timers set with the same event reset the timer to the new one, instead of making multiple calls).

An Async Action is something that goes on for a not necessarily fixed length of time, and completes whenever it is done. The Action can be used to do whatever you want to do over a length of time, and it will complete whenever you say it is done.

Async Actions are something you would use for like a remote service query, not just to delay something for a while. I very recently implemented a rather novel usage of an Async Action to get around a bug in an external library that I don’t want to deal with, where certain operations involving the external library actually takes longer than 1 tick to perform, even though it shouldn’t. Since it takes 2 ticks to run, I wrote an Async Action that performs the action, waits two ticks, and completes.

These are definitely not even remotely similar functionalities.

1 Like

Is The principle of UBlueprintAsyncActionBase implementation multi-threaded concurrency?

You don’t have to run an Async Action on a separate thread (although you could start something on a separate thread from the action, then return when the thread is complete), you can use it to do different operations on the game thread that take longer than a single tick to complete.

1 Like