Differences

This shows you the differences between two versions of the page.

Link to this comparison view

gdevelop5:events:callback-variables [2020/05/29 11:44] (current)
arthuro555 created
Line 1: Line 1:
 +====== Callback Variables ======
  
 +=== What are they? ===
 +Callback variables are **variables** passed to an **action** for passing a result to the user.
 +
 +=== Why do they exist? ===
 +Some actions have a very long execution time. So, to not block the game, they are designed in an **asynchronous** way. That means that they are being executed for a little while every frame until they are completed. Normally, you would use **[[gdevelop5:​all-features:​expressions|expressions]]** for getting a value in return, but asynchrounous actions **cannot** do that as they **would return nothing for multiple frames** (the time it takes to execute it). So they accept as argument a variable, and **set it's value** to the returned value **once finished**.