Event/functions, what's the main difference between them?

This is an interesting topic and I hope UE staff can give the perfect answer. The answer in this thread is not really helpful.

It isn’t distinctive if you use it in Blueprint. But from a programming standpoint, events are executed in a separate thread (subprocess), while functions are executed in the same thread.

So in computer, every execution flow is considered to be 1 thread. A collection of threads, is called a process. And a collection of process is called an application (it’s called a program during the DOS age).

So if you call a function, then the same thread that you use to call it, will execute the instructions inside that function. But if you call a custom event, then UE will generate another thread to execute the instructions inside that event. So you’ll have 2 executing thread that runs in parallel at the time you call an event. That’s why, you are not allowed to depend on the result of an event execution.

UE staff, please CMIIW about this.

18 Likes